Colour Functions

by Mobius Evalon
Convert between CMYK, hexadecimal, HSL, HSV and RGB. [More]
To download this library for your Linux/Mac installation, enter this on your command line:

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

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

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

224 downloads
Version 1.1.0.55
Date added: Jul 27 2008
Last updated: Feb 19 2010
0 fans
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".

Comments

ACWraith: (Apr 4 2011, 11:03 pm)
The reference could stand to be separated from the code, but this came in handy. =)