Color

home

color.rubyforge.org

code

github.com/halostatue/color

bugs

github.com/halostatue/color/issues

rdoc

rubydoc.info/github/halostatue/color

code climate

continuous integration

Description

Color is a Ruby library to provide basic RGB, CMYK, HSL, and other colourspace manipulation support to applications that require it. It also provides 152 named RGB colours (184 with spelling variations) that are commonly supported in HTML, SVG, and X11 applications. A technique for generating monochromatic contrasting palettes is also included.

The capabilities of the Color library are limited to pure mathematical manipulation of the colours based on colour theory without reference to colour profiles (such as sRGB or Adobe RGB). For most purposes, when working with the RGB and HSL colours, this won’t matter. However, some colour models (like CIE L*a*b*) are not supported because Color does not yet support colour profiles, giving no meaningful way to convert colours in absolute colour spaces (like L*a*b*, XYZ) to non-absolute colour spaces (like RGB).

Color version 1.4.2 updates the release and install as a RubyGem to remove an unnecessary dependency, adds code climate analysis, and Travis CI support.

History

Color is the result of a project merge between color.rb 0.1.0 by Matt Lyon and color-tools 1.3 by Austin Ziegler. Please see History.txt for details on the changes this merge brings.

Color::Palette::MonoContrast was developed based on techniques described by Andy “Malarkey” Clarke, implemented in JavaScript by Steve G. Chipman at SlayerOffice and by Patrick Fitzgerald of BarelyFitz in PHP.

1

www.stuffandnonsense.co.uk/archives/creating_colour_palettes.html

2

slayeroffice.com/tools/color_palette/

3

www.barelyfitz.com/projects/csscolor/

Contributing

I value any contribution to Color you can provide: a bug report, a feature request, or code contributions.

Code contributions to Color are especially <del>welcome</del>encouraged. Because Color is a complex codebase, there are a few guidelines:

Test Dependencies

To run the test suite, you will need to install the development dependencies for Color. If you have Bundler, you can accomplish this easily:

$ bundle install

Color uses Ryan Davis’s excellent Hoe to manage the release process, and it adds a number of rake tasks. You will mostly be interested in:

$ rake

which runs the tests the same way that:

$ rake spec
$ rake test
$ rake travis

will do.

Workflow

Here’s the most direct way to get your work merged into the project:

Contributors

Licence

This software is available under an MIT-style licence.

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.