Colour Functions

by Mobius Evalon
Convert between CMYK, hexadecimal, HSL, HSV and RGB.
Version 1.1.0.55 · Date Added: 7/28/08

If you wish to download this library for your Linux/Mac installation, enter the following on your command line:

DreamDownload byond://MobiusEvalon.colourfunctions##version=4

Emulator users, in the BYOND pager go to File | Open Location and enter this URL:

byond://MobiusEvalon.colourfunctions##version=4

What started as my desire to retrieve the luminosity value of an RGB triplet spawned this library -- the "modernized" version of the Hex/RGB Converter.

The Colour Functions Library (shortened to CF in many cases) is a quick and accurate tool to convert between five common colour schemas:

CMYK (cyan/magenta/yellow/key) - Used by the printing industry
Hexadecimal - Used by browsers for websafe colours
HSL (hue/saturation/luminosity) - Used by common drawing programs such as MSPaint and Dream Maker's icon editor
HSV (hue/saturation/value) - Used by photomanipulation programs such as Paint.NET and Photoshop
RGB (red/green/blue) - Common drawing program interfaces

One example of a trial run, converting between all five formats:

"255,128,64" as HSL is "13,240,150".
"13,240,150" as CMYK is "0,0.505882,0.74902,0".
"0,0.505882,0.74902,0" as HSV is "19,75,100".
"19,75,100" as Hex is "#ff7c40".
"#ff7c40" as RGB is "255,124,64".