https://next.observablehq.com/@brunurb/flow-o-matic-sankey-silvia
In the above sankey diagram I wanted the nodes colours to appear brighter than the links colour it worked for the other colours that I am using except the blue colour, could someone give me a clue how to make the blue nodes colour get brighter
Noob here
Thanks in advance for your replies.
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.
2 Likes
Thanks tophtucker it worked, and also thank you for the additional info, very informative and well explained.
All the best to you.
Bruno
1 Like