Sha256: a2eb1d2920e4212b165c06b5bf07d2150e3152aa98b66a4ea6c54e85551f918c

Contents?: true

Size: 632 Bytes

Versions: 4

Compression:

Stored size: 632 Bytes

Contents

#--
# Colour management with Ruby.
#
# Copyright 2005 Austin Ziegler
#   http://rubyforge.org/ruby-pdf/
#
#   Licensed under a MIT-style licence.
#
# $Id: css.rb,v 1.1 2005/08/05 23:07:20 austin Exp $
#++

require 'color'

  # This namespace contains some CSS colour names.
module Color::CSS
    # Returns the RGB colour for name or +nil+ if the name is not valid.
  def self.[](name)
    @colors[name.to_s.downcase.to_sym]
  end

  @colors = {}
  Color::RGB.constants.each do |const|
    next if const == "PDF_FORMAT_STR"
    next if const == "Metallic"
    @colors[const.downcase.to_sym] ||= Color::RGB.const_get(const)
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
color-tools-1.3.0 lib/color/css.rb
pdf-labels-2.0.1 vendor/color/css.rb
pdf-labels-1.0.1 vendor/color/css.rb
pdf-labels-1.0.0 vendor/color/css.rb