coloration 0.3.3 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,130 @@
1
+ #--
2
+ # Colour management with Ruby.
3
+ #
4
+ # Copyright 2005 Austin Ziegler
5
+ # http://rubyforge.org/ruby-pdf/
6
+ #
7
+ # Licensed under a MIT-style licence.
8
+ #
9
+ # $Id: hsl.rb,v 1.2 2005/08/08 02:44:17 austin Exp $
10
+ #++
11
+
12
+ # An HSL colour object. Internally, the hue (#h), saturation (#s), and
13
+ # luminosity (#l) values are dealt with as fractional values in the range
14
+ # 0..1.
15
+ class Color::HSL
16
+ class << self
17
+ # Creates an HSL colour object from fractional values 0..1.
18
+ def from_fraction(h = 0.0, s = 0.0, l = 0.0)
19
+ colour = Color::HSL.new
20
+ colour.h = h
21
+ colour.s = s
22
+ colour.l = l
23
+ colour
24
+ end
25
+ end
26
+
27
+ # Compares the other colour to this one. The other colour will be
28
+ # converted to HSL before comparison, so the comparison between a HSL
29
+ # colour and a non-HSL colour will be approximate and based on the other
30
+ # colour's #to_hsl conversion. If there is no #to_hsl conversion, this
31
+ # will raise an exception. This will report that two HSL values are
32
+ # equivalent if all component values are within 1e-4 (0.0001) of each
33
+ # other.
34
+ def ==(other)
35
+ other = other.to_hsl
36
+ other.kind_of?(Color::HSL) and
37
+ ((@h - other.h).abs <= 1e-4) and
38
+ ((@s - other.s).abs <= 1e-4) and
39
+ ((@l - other.l).abs <= 1e-4)
40
+ end
41
+
42
+ # Creates an HSL colour object from the standard values of degrees and
43
+ # percentages (e.g., 145�, 30%, 50%).
44
+ def initialize(h = 0, s = 0, l = 0)
45
+ @h = h / 360.0
46
+ @s = s / 100.0
47
+ @l = l / 100.0
48
+ end
49
+
50
+ # Present the colour as an HTML/CSS colour string.
51
+ def html
52
+ to_rgb.html
53
+ end
54
+
55
+ # Converting to HSL as adapted from Foley and Van-Dam from
56
+ # http://www.bobpowell.net/RGBHSB.htm.
57
+ def to_rgb(ignored = nil)
58
+ # If luminosity is zero, the colour is always black.
59
+ return Color::RGB.new if @l == 0
60
+ # If luminosity is one, the colour is always white.
61
+ return Color::RGB.new(0xff, 0xff, 0xff) if @l == 1
62
+ # If saturation is zero, the colour is always a greyscale colour.
63
+ return Color::RGB.new(@l, @l, @l) if @s <= 1e-5
64
+
65
+ if (@l - 0.5) < 1e-5
66
+ tmp2 = @l * (1.0 + @s.to_f)
67
+ else
68
+ tmp2 = @l + @s - (@l * @s.to_f)
69
+ end
70
+ tmp1 = 2.0 * @l - tmp2
71
+
72
+ t3 = [ @h + 1.0 / 3.0, @h, @h - 1.0 / 3.0 ]
73
+ t3 = t3.map { |tmp3|
74
+ tmp3 += 1.0 if tmp3 < 1e-5
75
+ tmp3 -= 1.0 if (tmp3 - 1.0) > 1e-5
76
+ tmp3
77
+ }
78
+
79
+ rgb = t3.map do |tmp3|
80
+ if ((6.0 * tmp3) - 1.0) < 1e-5
81
+ tmp1 + ((tmp2 - tmp1) * tmp3 * 6.0)
82
+ elsif ((2.0 * tmp3) - 1.0) < 1e-5
83
+ tmp2
84
+ elsif ((3.0 * tmp3) - 2.0) < 1e-5
85
+ tmp1 + (tmp2 - tmp1) * ((2 / 3.0) - tmp3) * 6.0
86
+ else
87
+ tmp1
88
+ end
89
+ end
90
+
91
+ Color::RGB.from_fraction(*rgb)
92
+ end
93
+
94
+ # Converts to RGB then YIQ.
95
+ def to_yiq
96
+ to_rgb.to_yiq
97
+ end
98
+
99
+ # Converts to RGB then CMYK.
100
+ def to_cmyk
101
+ to_rgb.to_cmyk
102
+ end
103
+
104
+ # Returns the luminosity (#l) of the colour.
105
+ def brightness
106
+ @l
107
+ end
108
+ def to_greyscale
109
+ Color::GrayScale.from_fraction(@l)
110
+ end
111
+ alias to_grayscale to_greyscale
112
+
113
+ attr_accessor :h, :s, :l
114
+ remove_method :h=, :s=, :l= ;
115
+ def h=(hh) #:nodoc:
116
+ hh = 1.0 if hh > 1
117
+ hh = 0.0 if hh < 0
118
+ @h = hh
119
+ end
120
+ def s=(ss) #:nodoc:
121
+ ss = 1.0 if ss > 1
122
+ ss = 0.0 if ss < 0
123
+ @s = ss
124
+ end
125
+ def l=(ll) #:nodoc:
126
+ ll = 1.0 if ll > 1
127
+ ll = 0.0 if ll < 0
128
+ @l = ll
129
+ end
130
+ end
@@ -0,0 +1,15 @@
1
+ #--
2
+ # Colour management with Ruby.
3
+ #
4
+ # Copyright 2005 Austin Ziegler
5
+ # http://rubyforge.org/ruby-pdf/
6
+ #
7
+ # Licensed under a MIT-style licence.
8
+ #
9
+ # $Id: palette.rb,v 1.2 2005/08/05 23:07:20 austin Exp $
10
+ #++
11
+
12
+ require 'coloration/color'
13
+
14
+ module Color::Palette
15
+ end
@@ -0,0 +1,107 @@
1
+ #--
2
+ # Colour management with Ruby.
3
+ #
4
+ # Copyright 2005 Austin Ziegler
5
+ # http://rubyforge.org/ruby-pdf/
6
+ #
7
+ # Licensed under a MIT-style licence.
8
+ #
9
+ # $Id: gimp.rb,v 1.3 2005/08/08 02:44:17 austin Exp $
10
+ #++
11
+
12
+ require 'coloration/color/palette'
13
+
14
+ # A class that can read a GIMP (GNU Image Manipulation Program) palette
15
+ # file and provide a Hash-like interface to the contents. GIMP colour
16
+ # palettes are RGB values only.
17
+ #
18
+ # Because two or more entries in a GIMP palette may have the same name,
19
+ # all named entries are returned as an array.
20
+ #
21
+ # pal = Color::Palette::Gimp.from_file(my_gimp_palette)
22
+ # pal[0] => Color::RGB<...>
23
+ # pal["white"] => [ Color::RGB<...> ]
24
+ # pal["unknown"] => [ Color::RGB<...>, Color::RGB<...>, ... ]
25
+ #
26
+ # GIMP Palettes are always indexable by insertion order (an integer key).
27
+ class Color::Palette::Gimp
28
+ include Enumerable
29
+
30
+ class << self
31
+ # Create a GIMP palette object from the named file.
32
+ def from_file(filename)
33
+ File.open(filename, "rb") { |io| Color::Palette::Gimp.from_io(io) }
34
+ end
35
+
36
+ # Create a GIMP palette object from the provided IO.
37
+ def from_io(io)
38
+ Color::Palette::Gimp.new(io.read)
39
+ end
40
+ end
41
+
42
+ # Create a new GIMP palette.
43
+ def initialize(palette)
44
+ @colors = []
45
+ @names = {}
46
+ @valid = false
47
+ @name = "(unnamed)"
48
+
49
+ index = 0
50
+
51
+ palette.split($/).each do |line|
52
+ line.chomp!
53
+ line.gsub!(/\s*#.*\Z/, '')
54
+
55
+ next if line.empty?
56
+
57
+ if line =~ /\AGIMP Palette\Z/
58
+ @valid = true
59
+ next
60
+ end
61
+
62
+ info = /(\w+):\s(.*$)/.match(line)
63
+ if info
64
+ @name = info.captures[1] if info.captures[0] =~ /name/i
65
+ next
66
+ end
67
+
68
+ line.gsub!(/^\s+/, '')
69
+ data = line.split(/\s+/, 4)
70
+ name = data.pop.strip
71
+ data.map! { |el| el.to_i }
72
+
73
+ color = Color::RGB.new(*data)
74
+
75
+ @colors[index] = color
76
+ @names[name] ||= []
77
+ @names[name] << color
78
+
79
+ index += 1
80
+ end
81
+ end
82
+
83
+ def [](key)
84
+ if key.kind_of?(Numeric)
85
+ @colors[key]
86
+ else
87
+ @names[key]
88
+ end
89
+ end
90
+
91
+ # Loops through each colour.
92
+ def each
93
+ @colors.each { |el| yield el }
94
+ end
95
+
96
+ # Loops through each named colour set.
97
+ def each_name #:yields color_name, color_set:#
98
+ @names.each { |color_name, color_set| yield color_name, color_set }
99
+ end
100
+
101
+ # Returns true if this is believed to be a valid GIMP palette.
102
+ def valid?
103
+ @valid
104
+ end
105
+
106
+ attr_reader :name
107
+ end
@@ -0,0 +1,180 @@
1
+ #--
2
+ # Colour management with Ruby.
3
+ #
4
+ # Copyright 2005 Austin Ziegler
5
+ # http://rubyforge.org/ruby-pdf/
6
+ #
7
+ # Licensed under a MIT-style licence.
8
+ #
9
+ # $Id: monocontrast.rb,v 1.3 2005/08/08 02:44:17 austin Exp $
10
+ #++
11
+
12
+ require 'coloration/color/palette'
13
+
14
+ # Generates a monochromatic constrasting colour palette for background and
15
+ # foreground. What does this mean?
16
+ #
17
+ # Monochromatic: A single colour is used to generate the base palette, and
18
+ # this colour is lightened five times and darkened five times to provide
19
+ # eleven distinct colours.
20
+ #
21
+ # Contrasting: The foreground is also generated as a monochromatic colour
22
+ # palettte; however, all generated colours are tested to see that they are
23
+ # appropriately contrasting to ensure maximum readability of the
24
+ # foreground against the background.
25
+ class Color::Palette::MonoContrast
26
+ # Hash of CSS background colour values.
27
+ #
28
+ # This is always 11 values:
29
+ #
30
+ # 0:: The starting colour.
31
+ # +1..+5:: Lighter colours.
32
+ # -1..-5:: Darker colours.
33
+ attr_reader :background
34
+ # Hash of CSS foreground colour values.
35
+ #
36
+ # This is always 11 values:
37
+ #
38
+ # 0:: The starting colour.
39
+ # +1..+5:: Lighter colours.
40
+ # -1..-5:: Darker colours.
41
+ attr_reader :foreground
42
+
43
+ DEFAULT_MINIMUM_BRIGHTNESS_DIFF = (125.0 / 255.0)
44
+
45
+ # The minimum brightness difference between the background and the
46
+ # foreground, and must be between 0..1. Setting this value will
47
+ # regenerate the palette based on the base colours. The default value
48
+ # for this is 125 / 255.0. If this value is set to +nil+, it will be
49
+ # restored to the default.
50
+ attr_accessor :minimum_brightness_diff
51
+ remove_method :minimum_brightness_diff= ;
52
+ def minimum_brightness_diff=(bd) #:nodoc:
53
+ if bd.nil?
54
+ @minimum_brightness_diff = DEFAULT_MINIMUM_BRIGHTNESS_DIFF
55
+ elsif bd > 1.0
56
+ @minimum_brightness_diff = 1.0
57
+ elsif bd < 0.0
58
+ @minimum_brightness_diff = 0.0
59
+ else
60
+ @minimum_brightness_diff = bd
61
+ end
62
+
63
+ regenerate(@background[0], @foreground[0])
64
+ end
65
+
66
+ DEFAULT_MINIMUM_COLOR_DIFF = (500.0 / 255.0)
67
+
68
+ # The minimum colour difference between the background and the
69
+ # foreground, and must be between 0..3. Setting this value will
70
+ # regenerate the palette based on the base colours. The default value
71
+ # for this is 500 / 255.0.
72
+ attr_accessor :minimum_color_diff
73
+ remove_method :minimum_color_diff= ;
74
+ def minimum_color_diff=(cd) #:noco:
75
+ if cd.nil?
76
+ @minimum_color_diff = DEFAULT_MINIMUM_COLOR_DIFF
77
+ elsif cd > 3.0
78
+ @minimum_color_diff = 3.0
79
+ elsif cd < 0.0
80
+ @minimum_color_diff = 0.0
81
+ else
82
+ @minimum_color_diff = cd
83
+ end
84
+ regenerate(@background[0], @foreground[0])
85
+ end
86
+
87
+ # Generate the initial palette.
88
+ def initialize(background, foreground = nil)
89
+ @minimum_brightness_diff = DEFAULT_MINIMUM_BRIGHTNESS_DIFF
90
+ @minimum_color_diff = DEFAULT_MINIMUM_COLOR_DIFF
91
+
92
+ regenerate(background, foreground)
93
+ end
94
+
95
+ # Generate the colour palettes.
96
+ def regenerate(background, foreground = nil)
97
+ foreground ||= background
98
+ background = background.to_rgb
99
+ foreground = foreground.to_rgb
100
+
101
+ @background = {}
102
+ @foreground = {}
103
+
104
+ @background[-5] = background.darken_by(10)
105
+ @background[-4] = background.darken_by(25)
106
+ @background[-3] = background.darken_by(50)
107
+ @background[-2] = background.darken_by(75)
108
+ @background[-1] = background.darken_by(85)
109
+ @background[ 0] = background
110
+ @background[+1] = background.lighten_by(85)
111
+ @background[+2] = background.lighten_by(75)
112
+ @background[+3] = background.lighten_by(50)
113
+ @background[+4] = background.lighten_by(25)
114
+ @background[+5] = background.lighten_by(10)
115
+
116
+ @foreground[-5] = calculate_foreground(@background[-5], foreground)
117
+ @foreground[-4] = calculate_foreground(@background[-4], foreground)
118
+ @foreground[-3] = calculate_foreground(@background[-3], foreground)
119
+ @foreground[-2] = calculate_foreground(@background[-2], foreground)
120
+ @foreground[-1] = calculate_foreground(@background[-1], foreground)
121
+ @foreground[ 0] = calculate_foreground(@background[ 0], foreground)
122
+ @foreground[+1] = calculate_foreground(@background[+1], foreground)
123
+ @foreground[+2] = calculate_foreground(@background[+2], foreground)
124
+ @foreground[+3] = calculate_foreground(@background[+3], foreground)
125
+ @foreground[+4] = calculate_foreground(@background[+4], foreground)
126
+ @foreground[+5] = calculate_foreground(@background[+5], foreground)
127
+ end
128
+
129
+ # Given a background colour and a foreground colour, modifies the
130
+ # foreground colour so that it will have enough contrast to be seen
131
+ # against the background colour.
132
+ #
133
+ # Uses #mininum_brightness_diff and #minimum_color_diff.
134
+ def calculate_foreground(background, foreground)
135
+ nfg = nil
136
+ # Loop through brighter and darker versions of the foreground color.
137
+ # The numbers here represent the amount of foreground color to mix
138
+ # with black and white.
139
+ [100, 75, 50, 25, 0].each do |percent|
140
+ dfg = foreground.darken_by(percent)
141
+ lfg = foreground.lighten_by(percent)
142
+
143
+ dbd = brightness_diff(background, dfg)
144
+ lbd = brightness_diff(background, lfg)
145
+
146
+ if lbd > dbd
147
+ nfg = lfg
148
+ nbd = lbd
149
+ else
150
+ nfg = dfg
151
+ nbd = dbd
152
+ end
153
+
154
+ ncd = color_diff(background, nfg)
155
+
156
+ break if nbd >= @minimum_brightness_diff and ncd >= @minimum_color_diff
157
+ end
158
+ nfg
159
+ end
160
+
161
+ # Returns the absolute difference between the brightness levels of two
162
+ # colours. This will be a decimal value between 0 and 1. W3C
163
+ # accessibility guidelines for colour
164
+ # contrast[http://www.w3.org/TR/AERT#color-contrast] suggest that this
165
+ # value be at least approximately 0.49 (125 / 255.0) for proper contrast.
166
+ def brightness_diff(c1, c2)
167
+ (c1.brightness - c2.brightness).abs
168
+ end
169
+
170
+ # Returns the contrast between to colours, a decimal value between 0 and
171
+ # 3. W3C accessibility guidelines for colour
172
+ # contrast[http://www.w3.org/TR/AERT#color-contrast] suggest that this
173
+ # value be at least approximately 1.96 (500 / 255.0) for proper contrast.
174
+ def color_diff(c1, c2)
175
+ r = (c1.r - c2.r).abs
176
+ g = (c1.g - c2.g).abs
177
+ b = (c1.b - c2.b).abs
178
+ r + g + b
179
+ end
180
+ end
@@ -0,0 +1,189 @@
1
+ #--
2
+ # Colour management with Ruby.
3
+ #
4
+ # Copyright 2005 Austin Ziegler
5
+ # http://rubyforge.org/ruby-pdf/
6
+ #
7
+ # Licensed under a MIT-style licence.
8
+ #
9
+ # $Id: rgb-colors.rb,v 1.1 2005/08/05 23:07:20 austin Exp $
10
+ #++
11
+
12
+ class Color::RGB
13
+ AliceBlue = Color::RGB.new(0xf0, 0xf8, 0xff).freeze
14
+ AntiqueWhite = Color::RGB.new(0xfa, 0xeb, 0xd7).freeze
15
+ Aqua = Color::RGB.new(0x00, 0xff, 0xff).freeze
16
+ Aquamarine = Color::RGB.new(0x7f, 0xff, 0xd4).freeze
17
+ Azure = Color::RGB.new(0xf0, 0xff, 0xff).freeze
18
+ Beige = Color::RGB.new(0xf5, 0xf5, 0xdc).freeze
19
+ Bisque = Color::RGB.new(0xff, 0xe4, 0xc4).freeze
20
+ Black = Color::RGB.new(0, 0, 0).freeze
21
+ BlanchedAlmond = Color::RGB.new(0xff, 0xeb, 0xcd).freeze
22
+ Blue = Color::RGB.new(0x00, 0x00, 0xff).freeze
23
+ BlueViolet = Color::RGB.new(0x8a, 0x2b, 0xe2).freeze
24
+ Brown = Color::RGB.new(0xa5, 0x2a, 0x2a).freeze
25
+ Burlywood = Color::RGB.new(0xde, 0xb8, 0x87).freeze
26
+ BurlyWood = Burlywood
27
+ CadetBlue = Color::RGB.new(0x5f, 0x9e, 0xa0).freeze
28
+ Chartreuse = Color::RGB.new(0x7f, 0xff, 0x00).freeze
29
+ Chocolate = Color::RGB.new(0xd2, 0x69, 0x1e).freeze
30
+ Coral = Color::RGB.new(0xff, 0x7f, 0x50).freeze
31
+ CornflowerBlue = Color::RGB.new(0x64, 0x95, 0xed).freeze
32
+ Cornsilk = Color::RGB.new(0xff, 0xf8, 0xdc).freeze
33
+ Crimson = Color::RGB.new(0xdc, 0x14, 0x3c).freeze
34
+ Cyan = Color::RGB.new(0x00, 0xff, 0xff).freeze
35
+ DarkBlue = Color::RGB.new(0x00, 0x00, 0x8b).freeze
36
+ DarkCyan = Color::RGB.new(0x00, 0x8b, 0x8b).freeze
37
+ DarkGoldenrod = Color::RGB.new(0xb8, 0x86, 0x0b).freeze
38
+ DarkGoldenRod = DarkGoldenrod
39
+ DarkGray = Color::RGB.new(0xa9, 0xa9, 0xa9).freeze
40
+ DarkGreen = Color::RGB.new(0x00, 0x64, 0x00).freeze
41
+ DarkGrey = DarkGray
42
+ DarkKhaki = Color::RGB.new(0xbd, 0xb7, 0x6b).freeze
43
+ DarkMagenta = Color::RGB.new(0x8b, 0x00, 0x8b).freeze
44
+ DarkoliveGreen = Color::RGB.new(0x55, 0x6b, 0x2f).freeze
45
+ DarkOliveGreen = DarkoliveGreen
46
+ Darkorange = Color::RGB.new(0xff, 0x8c, 0x00).freeze
47
+ DarkOrange = Darkorange
48
+ DarkOrchid = Color::RGB.new(0x99, 0x32, 0xcc).freeze
49
+ DarkRed = Color::RGB.new(0x8b, 0x00, 0x00).freeze
50
+ Darksalmon = Color::RGB.new(0xe9, 0x96, 0x7a).freeze
51
+ DarkSalmon = Darksalmon
52
+ DarkSeaGreen = Color::RGB.new(0x8f, 0xbc, 0x8f).freeze
53
+ DarkSlateBlue = Color::RGB.new(0x48, 0x3d, 0x8b).freeze
54
+ DarkSlateGray = Color::RGB.new(0x2f, 0x4f, 0x4f).freeze
55
+ DarkSlateGrey = DarkSlateGray
56
+ DarkTurquoise = Color::RGB.new(0x00, 0xce, 0xd1).freeze
57
+ DarkViolet = Color::RGB.new(0x94, 0x00, 0xd3).freeze
58
+ DeepPink = Color::RGB.new(0xff, 0x14, 0x93).freeze
59
+ DeepSkyBlue = Color::RGB.new(0x00, 0xbf, 0xbf).freeze
60
+ DimGray = Color::RGB.new(0x69, 0x69, 0x69).freeze
61
+ DimGrey = DimGray
62
+ DodgerBlue = Color::RGB.new(0x1e, 0x90, 0xff).freeze
63
+ Feldspar = Color::RGB.new(0xd1, 0x92, 0x75).freeze
64
+ Firebrick = Color::RGB.new(0xb2, 0x22, 0x22).freeze
65
+ FireBrick = Firebrick
66
+ FloralWhite = Color::RGB.new(0xff, 0xfa, 0xf0).freeze
67
+ ForestGreen = Color::RGB.new(0x22, 0x8b, 0x22).freeze
68
+ Fuchsia = Color::RGB.new(0xff, 0x00, 0xff).freeze
69
+ Gainsboro = Color::RGB.new(0xdc, 0xdc, 0xdc).freeze
70
+ GhostWhite = Color::RGB.new(0xf8, 0xf8, 0xff).freeze
71
+ Gold = Color::RGB.new(0xff, 0xd7, 0x00).freeze
72
+ Goldenrod = Color::RGB.new(0xda, 0xa5, 0x20).freeze
73
+ GoldenRod = Goldenrod
74
+ Gray = Color::RGB.new(0x80, 0x80, 0x80).freeze
75
+ Green = Color::RGB.new(0x00, 0x80, 0x00).freeze
76
+ GreenYellow = Color::RGB.new(0xad, 0xff, 0x2f).freeze
77
+ Grey = Gray
78
+ Honeydew = Color::RGB.new(0xf0, 0xff, 0xf0).freeze
79
+ HoneyDew = Honeydew
80
+ HotPink = Color::RGB.new(0xff, 0x69, 0xb4).freeze
81
+ IndianRed = Color::RGB.new(0xcd, 0x5c, 0x5c).freeze
82
+ Indigo = Color::RGB.new(0x4b, 0x00, 0x82).freeze
83
+ Ivory = Color::RGB.new(0xff, 0xff, 0xf0).freeze
84
+ Khaki = Color::RGB.new(0xf0, 0xe6, 0x8c).freeze
85
+ Lavender = Color::RGB.new(0xe6, 0xe6, 0xfa).freeze
86
+ LavenderBlush = Color::RGB.new(0xff, 0xf0, 0xf5).freeze
87
+ LawnGreen = Color::RGB.new(0x7c, 0xfc, 0x00).freeze
88
+ LemonChiffon = Color::RGB.new(0xff, 0xfa, 0xcd).freeze
89
+ LightBlue = Color::RGB.new(0xad, 0xd8, 0xe6).freeze
90
+ LightCoral = Color::RGB.new(0xf0, 0x80, 0x80).freeze
91
+ LightCyan = Color::RGB.new(0xe0, 0xff, 0xff).freeze
92
+ LightGoldenrodYellow = Color::RGB.new(0xfa, 0xfa, 0xd2).freeze
93
+ LightGoldenRodYellow = LightGoldenrodYellow
94
+ LightGray = Color::RGB.new(0xd3, 0xd3, 0xd3).freeze
95
+ LightGreen = Color::RGB.new(0x90, 0xee, 0x90).freeze
96
+ LightGrey = LightGray
97
+ LightPink = Color::RGB.new(0xff, 0xb6, 0xc1).freeze
98
+ Lightsalmon = Color::RGB.new(0xff, 0xa0, 0x7a).freeze
99
+ LightSalmon = Lightsalmon
100
+ LightSeaGreen = Color::RGB.new(0x20, 0xb2, 0xaa).freeze
101
+ LightSkyBlue = Color::RGB.new(0x87, 0xce, 0xfa).freeze
102
+ LightSlateBlue = Color::RGB.new(0x84, 0x70, 0xff).freeze
103
+ LightSlateGray = Color::RGB.new(0x77, 0x88, 0x99).freeze
104
+ LightSlateGrey = LightSlateGray
105
+ LightsteelBlue = Color::RGB.new(0xb0, 0xc4, 0xde).freeze
106
+ LightSteelBlue = LightsteelBlue
107
+ LightYellow = Color::RGB.new(0xff, 0xff, 0xe0).freeze
108
+ Lime = Color::RGB.new(0x00, 0xff, 0x00).freeze
109
+ LimeGreen = Color::RGB.new(0x32, 0xcd, 0x32).freeze
110
+ Linen = Color::RGB.new(0xfa, 0xf0, 0xe6).freeze
111
+ Magenta = Color::RGB.new(0xff, 0x00, 0xff).freeze
112
+ Maroon = Color::RGB.new(0x80, 0x00, 0x00).freeze
113
+ MediumAquamarine = Color::RGB.new(0x66, 0xcd, 0xaa).freeze
114
+ MediumAquaMarine = MediumAquamarine
115
+ MediumBlue = Color::RGB.new(0x00, 0x00, 0xcd).freeze
116
+ MediumOrchid = Color::RGB.new(0xba, 0x55, 0xd3).freeze
117
+ MediumPurple = Color::RGB.new(0x93, 0x70, 0xdb).freeze
118
+ MediumSeaGreen = Color::RGB.new(0x3c, 0xb3, 0x71).freeze
119
+ MediumSlateBlue = Color::RGB.new(0x7b, 0x68, 0xee).freeze
120
+ MediumSpringGreen = Color::RGB.new(0x00, 0xfa, 0x9a).freeze
121
+ MediumTurquoise = Color::RGB.new(0x48, 0xd1, 0xcc).freeze
122
+ MediumVioletRed = Color::RGB.new(0xc7, 0x15, 0x85).freeze
123
+ MidnightBlue = Color::RGB.new(0x19, 0x19, 0x70).freeze
124
+ MintCream = Color::RGB.new(0xf5, 0xff, 0xfa).freeze
125
+ MistyRose = Color::RGB.new(0xff, 0xe4, 0xe1).freeze
126
+ Moccasin = Color::RGB.new(0xff, 0xe4, 0xb5).freeze
127
+ NavajoWhite = Color::RGB.new(0xff, 0xde, 0xad).freeze
128
+ Navy = Color::RGB.new(0x00, 0x00, 0x80).freeze
129
+ OldLace = Color::RGB.new(0xfd, 0xf5, 0xe6).freeze
130
+ Olive = Color::RGB.new(0x80, 0x80, 0x00).freeze
131
+ Olivedrab = Color::RGB.new(0x6b, 0x8e, 0x23).freeze
132
+ OliveDrab = Olivedrab
133
+ Orange = Color::RGB.new(0xff, 0xa5, 0x00).freeze
134
+ OrangeRed = Color::RGB.new(0xff, 0x45, 0x00).freeze
135
+ Orchid = Color::RGB.new(0xda, 0x70, 0xd6).freeze
136
+ PaleGoldenrod = Color::RGB.new(0xee, 0xe8, 0xaa).freeze
137
+ PaleGoldenRod = PaleGoldenrod
138
+ PaleGreen = Color::RGB.new(0x98, 0xfb, 0x98).freeze
139
+ PaleTurquoise = Color::RGB.new(0xaf, 0xee, 0xee).freeze
140
+ PaleVioletRed = Color::RGB.new(0xdb, 0x70, 0x93).freeze
141
+ PapayaWhip = Color::RGB.new(0xff, 0xef, 0xd5).freeze
142
+ Peachpuff = Color::RGB.new(0xff, 0xda, 0xb9).freeze
143
+ PeachPuff = Peachpuff
144
+ Peru = Color::RGB.new(0xcd, 0x85, 0x3f).freeze
145
+ Pink = Color::RGB.new(0xff, 0xc0, 0xcb).freeze
146
+ Plum = Color::RGB.new(0xdd, 0xa0, 0xdd).freeze
147
+ PowderBlue = Color::RGB.new(0xb0, 0xe0, 0xe6).freeze
148
+ Purple = Color::RGB.new(0x80, 0x00, 0x80).freeze
149
+ Red = Color::RGB.new(0xff, 0x00, 0x00).freeze
150
+ RosyBrown = Color::RGB.new(0xbc, 0x8f, 0x8f).freeze
151
+ RoyalBlue = Color::RGB.new(0x41, 0x69, 0xe1).freeze
152
+ SaddleBrown = Color::RGB.new(0x8b, 0x45, 0x13).freeze
153
+ Salmon = Color::RGB.new(0xfa, 0x80, 0x72).freeze
154
+ SandyBrown = Color::RGB.new(0xf4, 0xa4, 0x60).freeze
155
+ SeaGreen = Color::RGB.new(0x2e, 0x8b, 0x57).freeze
156
+ Seashell = Color::RGB.new(0xff, 0xf5, 0xee).freeze
157
+ SeaShell = Seashell
158
+ Sienna = Color::RGB.new(0xa0, 0x52, 0x2d).freeze
159
+ Silver = Color::RGB.new(0xc0, 0xc0, 0xc0).freeze
160
+ SkyBlue = Color::RGB.new(0x87, 0xce, 0xeb).freeze
161
+ SlateBlue = Color::RGB.new(0x6a, 0x5a, 0xcd).freeze
162
+ SlateGray = Color::RGB.new(0x70, 0x80, 0x90).freeze
163
+ SlateGrey = SlateGray
164
+ Snow = Color::RGB.new(0xff, 0xfa, 0xfa).freeze
165
+ SpringGreen = Color::RGB.new(0x00, 0xff, 0x7f).freeze
166
+ SteelBlue = Color::RGB.new(0x46, 0x82, 0xb4).freeze
167
+ Tan = Color::RGB.new(0xd2, 0xb4, 0x8c).freeze
168
+ Teal = Color::RGB.new(0x00, 0x80, 0x80).freeze
169
+ Thistle = Color::RGB.new(0xd8, 0xbf, 0xd8).freeze
170
+ Tomato = Color::RGB.new(0xff, 0x63, 0x47).freeze
171
+ Turquoise = Color::RGB.new(0x40, 0xe0, 0xd0).freeze
172
+ Violet = Color::RGB.new(0xee, 0x82, 0xee).freeze
173
+ VioletRed = Color::RGB.new(0xd0, 0x20, 0x90).freeze
174
+ Wheat = Color::RGB.new(0xf5, 0xde, 0xb3).freeze
175
+ White = Color::RGB.new(0xff, 0xff, 0xff).freeze
176
+ WhiteSmoke = Color::RGB.new(0xf5, 0xf5, 0xf5).freeze
177
+ Yellow = Color::RGB.new(0xff, 0xff, 0x00).freeze
178
+ YellowGreen = Color::RGB.new(0x9a, 0xcd, 0x32).freeze
179
+
180
+ Gray10 = Grey10 = Color::RGB.from_percentage(10, 10, 10).freeze
181
+ Gray20 = Grey20 = Color::RGB.from_percentage(20, 20, 20).freeze
182
+ Gray30 = Grey30 = Color::RGB.from_percentage(30, 30, 30).freeze
183
+ Gray40 = Grey40 = Color::RGB.from_percentage(40, 40, 40).freeze
184
+ Gray50 = Grey50 = Color::RGB.from_percentage(50, 50, 50).freeze
185
+ Gray60 = Grey60 = Color::RGB.from_percentage(60, 60, 60).freeze
186
+ Gray70 = Grey70 = Color::RGB.from_percentage(70, 70, 70).freeze
187
+ Gray80 = Grey80 = Color::RGB.from_percentage(80, 80, 80).freeze
188
+ Gray90 = Grey90 = Color::RGB.from_percentage(90, 90, 90).freeze
189
+ end