13
Spent 3 hours fighting a CSS gradient that should have taken 20 minutes
I was trying to make a sunset scene with a smooth gradient over some clouds and the colors kept looking muddy no matter what I adjusted. Turns out I was using RGB hex codes instead of HSL values and that fixed the whole thing instantly. Has anyone else wasted way too long on something that had a dead simple fix?
2 comments
Log in to join the discussion
Log In2 Comments
michaelcoleman1d ago
I read this thing the other day about how our brains process color in HSL way more naturally than hex codes because hex is just complicated math for machines. Hit me like a ton of bricks because I've done the same thing with gradients where they just look like someone dumped paint buckets on each other. RGB hex codes stack up wrong when you're trying to blend across the color wheel, especially for sunsets with that orange to purple shift. HSL lets you just tweak the hue and saturation directly, which is what we're actually seeing when we look at a sky anyway. Bet that gradient looks killer now though.
2