A Ruby library built to handle the easy conversion and manipulation of colors with a special emphasis on W3C standards and CSS-style hex color notation.
Ruby
Pull request Compare This branch is 30 commits ahead of capnslipp:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
extractions
lib
test
.gitignore
.specification
CHANGELOG.rdoc
MIT_LICENSE.rdoc
README.rdoc
Rakefile
VERSION
kmandrup-colorist.gemspec

README.rdoc

Colorist

Colorist is a library built to handle the conversion, comparison, and manipulation of colors in Ruby projects with an emphasis on W3C standards and CSS-style hex notation. See the Color class for additional details on the available methods.

Example

require 'colorist'
include Colorist

gray = Color.new(0x333333)
gray + gray     # => #<Color #666666>
gray - "#333"   # => #<Color #000000>

gray.invert     # => #<Color #cccccc>
gray.brightness # => 0.2

gray.contrast_with("#f00")

Installation

First, make sure you have GemCutter set up:

gem install gemcutter
gem tumble

Then, grab the gem:

gem install slippyd-colorist

Last, add the requirement to your project and enjoy!

# in environment.rb, after "Rails::Initializer.run do |config|":
config.gem 'slippyd-colorist', :lib => false, :version => '0.0.5'

# in any class or module that you want to use Colorist:
include Colorist

Resources

Copyright © 2008 Michael Bleigh and Intridea, Inc. Released under the MIT open source license.