Jump to content

Recommended Posts

Posted

Is there any existing function to convert RGB values to HLS (Hue, Luminosity and Saturation)? or existing script? I want to use GetPixelColor and find out the HLS values for it.

Thanks.

Posted

Awesome stuff. I made a slight tweak.

Original Code:

;convert to 0-255 ranges

;h [0-360], h,l [0-1]

$l *= 240

$s *= 240

$h = ($h/360)*240

Replacement Code (switch to 255 as max):

;convert to 0-255 ranges

;h [0-360], h,l [0-1]

$l *= 255

$s *= 255

$h = ($h/360)*255

After that change, its perfectly matches the data in MouseZoom which I use:

Larry, where you found the code, is there's a RGB/HSL conversion to CMYB (Cyan Magena Yellow Black) code?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...