Module: Color

Defined in:
lib/color.rb,
lib/color.rb,
lib/color/grayscale.rb

Overview

Colour Management with Ruby

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::Palette 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.

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 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 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.

Defined Under Namespace

Modules: CSS, Palette Classes: CMYK, GrayScale, RGB, YIQ

Constant Summary collapse

COLOR_TOOLS_VERSION =
'1.3.0'
GreyScale =

A synonym for Color::GrayScale.

GrayScale

Class Method Summary collapse

Class Method Details

.const_missing(name) ⇒ Object

:nodoc:



73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/color.rb', line 73

def self.const_missing(name) #:nodoc:
  if Color::RGB.const_defined?(name)
    warn "These colour constants have been deprecated. Use Color::RGB::#{name} instead."
    Color::RGB::constants.each do |const|
      next if const == "PDF_FORMAT_STR"
      next if const == "Metallic"
      const_set(const, Color::RGB.const_get(const))
    end
    class << Color; remove_method :const_missing; end
    Color.const_get(name)
  else
    super
  end
end