As you can see in the screenshot below, calling brighter
on RGB blue (0, 0, 255) just makes the blue channel even higher — but it can’t go higher than 255, so it comes out the same.
If you use HSL (which is as easy as adding .formatHsl()
), it comes out more consistently. (The docs for brighter
note that “The behavior of this method is dependent on the implementing color space.”)
Edit: Here’s the tweak in a notebook suggestion you can merge.
To my eye, the blue still doesn’t appear as much brighter as the green does — but at that point you’re in the wild world of color perception, hah. There’s great wild research on perceptually uniform rainbows, and great tools for generating color palettes; I get easily overwhelmed by the topic, and I don’t know how much it bothers you. I don’t know how you picked these colors (and maybe you’ve already tried this), but some of these scales may offer more consistent brightness.