Jump to content

Coverting RGB -> HLS function


Taurus99
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...