{"post":{"title":"Behind the Scenes: Colours","shortTitle":"Behind the Scenes","status":200,"description":"A blog post explaining what I learned about WGCA colour contrast","linkSlug":"bts/colour","permalinkSlug":"colours","guid":"1e299f03-504f-4b7c-9038-c4980167693d","firstCreated":"2026-10-23T00:00:00.000Z","lastModified":"2026-11-03T16:00:00.000Z","showInFeed":true,"content":[{"type":"Markdown","value":["# Colour contrast","Because the [contact form](https://lucas-leprince.com/contact) has a favourite colour option I thought it would be a fun challenge to auto colour the confirmation emails people receive using their favourite colour","Feel free to play around and select different colours to see how it works"],"alt":"explaining the colour contrast tool I made"},{"type":"Markdown","value":["To visualize this the [webpage](https://lucas-leprince.com/web/default/bts/colour.html) version of this is ideal however I have done my best to translate it ","if you would prefer in it json please go to [https://lucas-leprince.com//bts/colour.json?colour=#EE0000](https://lucas-leprince.com//bts/colour.json?colour=#EE0000) to select a colour, the colour doesn't have to be #EE0000 it can be any hex colour"],"alt":"explaining where you should go"},{"type":"Markdown","value":["Finding the worst possible colour was an interesting goal and it took a couple attempts to get right","At first I pre calculated all possible values of each channel (which I have done here for [red](https://lucas-leprince.com//api/extras/hex/red), [green](https://lucas-leprince.com//api/extras/hex/green) [blue](https://lucas-leprince.com//api/extras/hex/blue) and [the value pre multiplication](https://lucas-leprince.com//api/extras/hex)).","I also used the contrast value from above and tried to find the three colours that were as dissimilar as possible.","The problem was that the algorythm was only optimizing one of the two goals at a time and I needed to try a different approach \n","Instead of RGB I used hsl (hue, saturation, and lightness) this was much easier to work with because changing hue is how I got the \"opposite\" colour while lightness is how I gave them the same luminance"],"alt":"My post mortem"},{"type":"Markdown","value":["## Takeaways","1. contrast is exclusively a matter of how dark or light the colours are and nothing to do with their spot on the colour wheel","2. Blue is seen as a much darker colour than red and green so if you are trying to fix contrast tweak red and green first","3. Depending on whether you need a contrast ratio of 3:1 or 4.5:1 you can have up to 4 or 3 colours respectively before some of the colour combinations will be below the given threshold"],"alt":"Conclusion"},{"type":"Buttons","alt":"Button To decide where to go next","value":{"Return Home":{"url":"https://lucas-leprince.com/index.json","MIMEType":"application/json"},"Behind the scenes":{"url":"https://lucas-leprince.com/bts.json","MIMEType":"application/json"}}},{"type":"ModeButtons","value":{"Dark Mode":{"url":"https://lucas-leprince.com/bts/colour?mode=dark","MIMEtype":"text/html"},"Light Mode":{"url":"https://lucas-leprince.com/bts/colour?mode=light","MIMEtype":"text/html"},"Rainbow Mode":{"url":"https://lucas-leprince.com/bts/colour?mode=rainbow","MIMEtype":"text/html"},"Terminal Mode":{"url":"https://lucas-leprince.com/bts/colour?mode=terminal","MIMEtype":"text/html"},"Markdown":{"url":"https://lucas-leprince.com/bts/colour.md","MIMEtype":"text/markdown"},"JWT":{"url":"https://lucas-leprince.com/api/bts/colour/token","MIMEtype":"application/jwt"},"Database":{"url":"https://lucas-leprince.com/database.json","MIMEtype":"json"}}},{"type":"ProgressTracker","progress":{"url":"https://lucas-leprince.com/progress.json","MIMEtype":"application/json"}}],"footer":{"GitHub":"https://github.com/LePetitPrince-4","GitLab":"https://gitlab.com/LePetitPrince4","LinkedIn":"https://www.linkedin.com/in/lucas-leprince/","PGP key":"https://lucas-leprince.com/pgp-key","RSS Feed":"https://lucas-leprince.com/feed","Sitemap":"https://lucas-leprince.com/sitemap.xml"},"permalink":"https://lucas-leprince.com/permalink/v1/1e299f03-504f-4b7c-9038-c4980167693d/json","permalinks":{"v1":"https://lucas-leprince.com/permalink/v1/1e299f03-504f-4b7c-9038-c4980167693d/json","v2":"https://lucas-leprince.com/permalink/v2/colours/json"}}}