Convert RGB to C2's 1-100 based RGB format?

Get help using Construct 2

Post » Sat Sep 07, 2013 8:24 pm

I was wondering if anyone has a quick and easy way to convert a RGB value into the C2 format.

Usually I get 3 values ranging from 0-256 when I am testing for color values.

In C2 I am using the setColor and setTint effects which have a RGB system that ranges from 0-100.

Eg. Neutrail gray RGB is 128,128,128... In C2 it is 50,50,50.

Does anyone have a slick and easy way to convert a Construct 2 ,0-100 value into a RGB, 0-256 value?


Thanks in Advanced.jojoe2013-09-07 20:26:15
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Sat Sep 07, 2013 11:24 pm

If all you need is to map a number from range 0-255 to range 0-100, then just divide it by 2.55. To map it the other way, multiply it by 2.55.
B
4
S
1
Posts: 2
Reputation: 279

Post » Sun Sep 08, 2013 2:07 am

@The Martin, Than you so much!

I had a feeling it was something simple. This will really help me out :)
B
29
S
8
G
4
Posts: 767
Reputation: 5,985


Return to How do I....?

Who is online

Users browsing this forum: Jackriduk, kiki4construct, osek95 and 22 guests