DEV Community

Discussion on: Hex, rgba, or hsla?

Collapse
 
ahferroin7 profile image
Austin S. Hemmelgarn

For coding, almost always RGB (I only list the alpha channel if it needs a value other than full opacity). It's a bit easier to understand right off the bat (at least for me) than hex values are and it mirrors how the computer is (probably) actually handling colors.

When actually deciding on color schemes though, I often use HSL or HSV models, as they're easier to extrapolate theming from. For example, it's trivial to find the complement of a color using a HSL or HSV model, because you only have to adjust one of the values, while for RGB you need to adjust all three (in potentially complicated ways if you don't want the direct complement of the base color).