Home

Awesome

hxColorToolkit

Build Status

A Haxe library for color conversion and color scheme generation.

It is based on colortoolkit with lots of bug fixs and enhancements.

Usage

Install it from haxelib: haxelib install hxColorToolkit

using hxColorToolkit.ColorToolkit;

var hexColor = 0x112233.toHex();
trace(hexColor.red); //0x11
trace(hexColor.green); //0x22
trace(hexColor.blue); //0x33

var hslColor = new hxColorToolkit.spaces.HSL(0, 100, 50); //construct a color in HSL space
trace(hslColor.getColor()); //0xFF0000 the hex color value

Color spaces

They can be found inside the package hxColorToolkit.spaces. All of them implement the interface hxColorToolkit.spaces.Color.

All channel values are clamped to their possible min/max, except hue values of HSB and HSL are looped inside 0-360 (color.hue = -10; trace(color.hue); //350).

Color schemes

Color scheme is basically a set of colors, constructed according to color theory.

The classes can be found inside the package hxColorToolkit.schemes. All of them implement the interface hxColorToolkit.schemes.ColorScheme.

License

hxColorToolkit

The MIT License

Copyright (c) 2010-2016 Andy Li http://www.onthewings.net/

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

colortoolkit

The MIT License

Copyright (c) 2009 P.J. Onori (pj@somerandomdude.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.