As a developer, managing colors can be tedious, but there are “developer friendly” solutions, HSLuv is one of them and I will explain what it is and how it can help.
Traditionally in computing, we use RGB or HSL.
The problem with those color spaces is that they are non linear in term of human perception.
For example, let’s take the following stepped gradients, they are all composed of even spaced RGB colors.
#000, #100, #200, #FEE, #FFF,…#000, #010, #020, …#000, #001, #002, …#000, #110, #220, …#000, #011, #022, …#000, #101, #202, …#000, #111, #111, #222, #222, …We can see a few things:
Ok, RGB is how pixels are rendered, it was never designed to have “manipulable” values, so this is to be expected.
Let’s try the same with HSL. HSL is supposed to be much easier to work with, because we can keep the hue constant and modify the other two values.