Online tool for choosing colours

Share your advanced PureBasic knowledge/code with the community.
User avatar
Blue
Addict
Addict
Posts: 868
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Online tool for choosing colours

Post by Blue »

Sorry, but no code for this particular tip.

Just an external helpful link : https://galactic.ink/sphere/

If, like me, you find it difficult to choose and harmonize colours, you'll love this online colour tool.

Image
With the mouse, you move, as a group, the small numbered spheres around the large one, harmonizing automatically and on the fly around the colour under the mouse pointer.

You can see immediately whether a given colour scheme is pleasant and matches your expectations. Most importantly, you measure, at a glance, the impact your color choices will have on your masterpiece application.

For colour-dumb programmers (like me!), priceless ! It is the most helpful and flexible colour tool i've ever come across.
If you find it useful, let me know.


PS (to the moderator) : if my message has been posted in the wrong section, please let me know and move it to the correct one.
"That's not a bug..." said the programmer. "it's a feature! "
"Oh! I see..." replied the blind man.
User avatar
Keya
Addict
Addict
Posts: 1891
Joined: Thu Jun 04, 2015 7:10 am

Re: Online tool for choosing colours

Post by Keya »

i just had a quick peek at its javascript and noticed this interesting little snippet:

Code: Select all

// apply saturation using sRGB D65 Whitepoint
var n = 1 - config.hsl.S / 100;
var lum = ((rgb.R * 0.212656) + (rgb.G * 0.715158) + (rgb.B * 0.072186)) * n;
rgb.R = rgb.R * (1 - n) + lum;
rgb.G = rgb.G * (1 - n) + lum;
rgb.B = rgb.B * (1 - n) + lum;
forgive my colornewbiness but does anyone know if this all that's required to convert RGB values to sRGB?
User avatar
Blue
Addict
Addict
Posts: 868
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Re: Online tool for choosing colours

Post by Blue »

Keya wrote:[...]forgive my colornewbiness[...]
'colornewbiness' :shock:
Sorry, Keya; I don't have an answer to your question.
But i just had to congratulate you on your creativity with words. Impressive.
"That's not a bug..." said the programmer. "it's a feature! "
"Oh! I see..." replied the blind man.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Online tool for choosing colours

Post by JHPJHP »

Hi Keya, Blue,

It looks correct; the chromaticity numbers are frequently used in Color Space conversions:
- Procedure ConvertXYZ
- Procedure ConvertHunterLAB
- Procedure ConvertCIELAB
- Procedure ConvertCIELUV

Using PureBasic would require a little more work: n = 1 - config.hsl.S / 100
- Procedure ConvertHLS

NB*: The above Procedures can be found in Spider Web Drawing, demoed from the Context Menu.
User avatar
Keya
Addict
Addict
Posts: 1891
Joined: Thu Jun 04, 2015 7:10 am

Re: Online tool for choosing colours

Post by Keya »

groovy functions JHP²! so it seems it's RGB -> HSL -> sRGB
Post Reply