Convering RGB input to HSL colour

Get help using Construct 2

Post » Wed Feb 06, 2013 4:49 pm

I am trying to let a user define the colour of parts of their character. I was thinking the best way to do this would be allow them to input the red, green and blue values for each piece. I would then add these values through an effect to each individual piece. However, the effect I found required me to input the Hue, Saturation and light values for the colour. How can I convert the red, green, blue input to HSL? I can't use an algorithm I've found online because of the way the event system works.
Nothing goes unanswered!
B
24
S
5
G
1
Posts: 434
Reputation: 3,446

Post » Wed Feb 06, 2013 6:12 pm

I'm sorry for not directly answering your question, but I find that HSL values are actually a lot more user intuitive than RGB values. If a user wants 'dark purple' for example, in an RGB system this would require a bit of experimentation from those not educated in color theory. In an HSL system, It's easy to find 'purple' then 'dark' and adjust the saturation if need be.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,689

Post » Wed Feb 06, 2013 7:07 pm

[quote]I can't use an algorithm I've found online because of the way the event system works.[/quote] Nonsense, I made a capx a while back that used those algorithms and was able to implement it in events just fine.
http://dl.dropbox.com/u/5426011/examples15/color_mix.capx
B
92
S
32
G
109
Posts: 5,290
Reputation: 70,991


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, dop2000, Yahoo [Bot] and 34 guests