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
22
S
5
G
1
Posts: 430
Reputation: 3,383

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
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

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
79
S
24
G
54
Posts: 4,754
Reputation: 40,771


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests