A
Austin Ziegler
I am pleased to announce the first release of color-tools. What, you
ask, is color-tools? It's a Ruby library to provide RGB and CMYK
colour support to applications that require it. It provides 148
named RGB colours that are commonly supported and used in HTML,
colour manipulation operations, and a monochromatic contrasting
palette generator.
Why do you need this? PDF::Writer 1.0.0 will require it.
Why do you want this? Because it provides RGB colour manipulation
(lightening and darkening, some colour mixing with opacity) and
conversion between RGB and CMYK. It understands HTML colours and
outputs as HTML, too, making this library useful for web
applications, too.
What's cool about this? There's a monochromatic contrasting palette
generator (Color:alette::MonoContrast).
red = Color:alette::MonoContrast.new(Color::Red)
red.background[-5] # => #<Color::RGB @g=0.0, @r=0.1, @b=0.0>
red.background[-4] # => #<Color::RGB @g=0.0, @r=0.25, @b=0.0>
red.background[-3] # => #<Color::RGB @g=0.0, @r=0.5, @b=0.0>
red.background[-2] # => #<Color::RGB @g=0.0, @r=0.75, @b=0.0>
red.background[-1] # => #<Color::RGB @g=0.0, @r=0.85, @b=0.0>
red.background[ 0] # => #<Color::RGB @g=0.0, @r=1.0, @b=0.0>
red.background[+1] # => #<Color::RGB @g=0.15, @r=1.0, @b=0.15>
red.background[+2] # => #<Color::RGB @g=0.25, @r=1.0, @b=0.25>
red.background[+3] # => #<Color::RGB @g=0.5, @r=1.0, @b=0.5>
red.background[+4] # => #<Color::RGB @g=0.75, @r=1.0, @b=0.75>
red.background[+5] # => #<Color::RGB @g=0.9, @r=1.0, @b=0.9>
What's missing? All kinds of stuff -- but I need you to tell me what
you want added to the next release of color-tools -- and even
contribute code.
Copyright 2005 by Austin Ziegler
Color::RGB and Color::CMYK were originally developed for the Ruby PDF
project and PDF::Writer and represent wholly unique code.
Color:alette was developed based on techniques described by Andy
"Malarkey" Clarke[1], implemented in JavaScript by Steve G. Chipman at
SlayerOffice[2] and by Patrick Fitzgerald of BarelyFitz[3] in PHP.
Licence
=======
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Soft-
ware"), 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 names of its contributors may not be used to endorse or promote
products derived from this software without specific prior written
permission.
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 MERCHANTABIL-
ITY, 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.
[1] http://www.stuffandnonsense.co.uk/archives/creating_colour_palettes.html
[2] http://slayeroffice.com/tools/color_palette/
[3] http://www.barelyfitz.com/projects/csscolor/
ask, is color-tools? It's a Ruby library to provide RGB and CMYK
colour support to applications that require it. It provides 148
named RGB colours that are commonly supported and used in HTML,
colour manipulation operations, and a monochromatic contrasting
palette generator.
Why do you need this? PDF::Writer 1.0.0 will require it.
Why do you want this? Because it provides RGB colour manipulation
(lightening and darkening, some colour mixing with opacity) and
conversion between RGB and CMYK. It understands HTML colours and
outputs as HTML, too, making this library useful for web
applications, too.
What's cool about this? There's a monochromatic contrasting palette
generator (Color:alette::MonoContrast).
red = Color:alette::MonoContrast.new(Color::Red)
red.background[-5] # => #<Color::RGB @g=0.0, @r=0.1, @b=0.0>
red.background[-4] # => #<Color::RGB @g=0.0, @r=0.25, @b=0.0>
red.background[-3] # => #<Color::RGB @g=0.0, @r=0.5, @b=0.0>
red.background[-2] # => #<Color::RGB @g=0.0, @r=0.75, @b=0.0>
red.background[-1] # => #<Color::RGB @g=0.0, @r=0.85, @b=0.0>
red.background[ 0] # => #<Color::RGB @g=0.0, @r=1.0, @b=0.0>
red.background[+1] # => #<Color::RGB @g=0.15, @r=1.0, @b=0.15>
red.background[+2] # => #<Color::RGB @g=0.25, @r=1.0, @b=0.25>
red.background[+3] # => #<Color::RGB @g=0.5, @r=1.0, @b=0.5>
red.background[+4] # => #<Color::RGB @g=0.75, @r=1.0, @b=0.75>
red.background[+5] # => #<Color::RGB @g=0.9, @r=1.0, @b=0.9>
What's missing? All kinds of stuff -- but I need you to tell me what
you want added to the next release of color-tools -- and even
contribute code.
Copyright 2005 by Austin Ziegler
Color::RGB and Color::CMYK were originally developed for the Ruby PDF
project and PDF::Writer and represent wholly unique code.
Color:alette was developed based on techniques described by Andy
"Malarkey" Clarke[1], implemented in JavaScript by Steve G. Chipman at
SlayerOffice[2] and by Patrick Fitzgerald of BarelyFitz[3] in PHP.
Licence
=======
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Soft-
ware"), 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 names of its contributors may not be used to endorse or promote
products derived from this software without specific prior written
permission.
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 MERCHANTABIL-
ITY, 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.
[1] http://www.stuffandnonsense.co.uk/archives/creating_colour_palettes.html
[2] http://slayeroffice.com/tools/color_palette/
[3] http://www.barelyfitz.com/projects/csscolor/