How do I check HSL values for a Layer?

Get help using Construct 2

Post » Tue Jul 25, 2017 7:56 am

Hi guyz,
i need to check hsl value for a layer so to control the saturation and luminosity values if they are too low or too high to maintain colors.... is there a way to do that in construct 2 itself or via a plugin?
I used fx effect hsl value but it only changes the hsl value, i cannot check what is the current hsl for the layer, and i want to keep track of it!
Pleaaseeee help asap ....
B
17
S
6
Posts: 91
Reputation: 1,388

Post » Tue Jul 25, 2017 5:59 pm

Anyone ????
Please help!!!
B
17
S
6
Posts: 91
Reputation: 1,388

Post » Wed Jul 26, 2017 5:28 am

To check the hsl values for a layer would require taking an average of all the pixels and getting it from that. At least that's how I understand it.

The only reliable way to get all the pixels that I know of is to use the snapshot action to get an image of the screen. Then you could load that image to a Sprite, resize it to 1x1, and paste that to a canvas object (third party plugin that can read pixels from an image). Basically make the canvas object 1x1 in the editor, and position the Sprite object in the same position.
Finally use the canvas.redAt(0,0) and similar functions to get the rgb average, more or less, of the layer. You can convert the rgb to hsl with algorithms that can be found online.

Anyways, that probably would work, just not very fast.

Really though this isn't something easily done in c2 if at all.
B
92
S
32
G
109
Posts: 5,294
Reputation: 70,999


Return to How do I....?

Who is online

Users browsing this forum: Kin, ratboy3, tinhofiel and 38 guests