Is there in any way i can extract luminance value from a color?

i was wondering if its possible to extract luminance value from example($bp(dominant, mi(cover))$)

Well I guess with some manipulation of the returned color value, breaking it into the individual RGB values using tc functions, converting them from hex to decimal and then from 0-255 range to a 0-1 range using mu functions and some maths and then using this luminance formula:

Luminance L, red R, green G, blue B

L = 0.2126 * R + 0.7152 * G + 0.0722 * B

You could calculate it.

1 Like

Here it is actually, taking the color #ffeedd as an example:

$0.2126 * mu(h2d, (tc(cut, #ffeedd, 1, 2)))/255 + 0.7152 * mu(h2d, (tc(cut, #ffeedd, 3, 2)))/255 + 0.0722 * mu(h2d, (tc(cut, #ffeedd, 5, 2)))/255$


thanks a lot it worked perfectly kudos man

1 Like

This topic was automatically closed 25 days after the last reply. New replies are no longer allowed.