cairo 1.8.3-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of cairo might be problematic. Click here for more details.
- data/AUTHORS +4 -0
- data/COPYING +59 -0
- data/GPL +340 -0
- data/NEWS +163 -0
- data/Rakefile +190 -0
- data/doc/doc.css +91 -0
- data/doc/en/cairo-antialias.html +38 -0
- data/doc/en/cairo-clip-not-representable-error.html +47 -0
- data/doc/en/cairo-color-base.html +69 -0
- data/doc/en/cairo-color-cmyk.html +157 -0
- data/doc/en/cairo-color-hsv.html +137 -0
- data/doc/en/cairo-color-rgb.html +142 -0
- data/doc/en/cairo-color-x11.html +173 -0
- data/doc/en/cairo-color.html +238 -0
- data/doc/en/cairo-content.html +37 -0
- data/doc/en/cairo-context-blur.html +39 -0
- data/doc/en/cairo-context-circle.html +39 -0
- data/doc/en/cairo-context-color.html +39 -0
- data/doc/en/cairo-context-path.html +44 -0
- data/doc/en/cairo-context-rectangle.html +39 -0
- data/doc/en/cairo-context-triangle.html +39 -0
- data/doc/en/cairo-context.html +643 -0
- data/doc/en/cairo-error.html +44 -0
- data/doc/en/cairo-extend.html +38 -0
- data/doc/en/cairo-file-not-found.html +47 -0
- data/doc/en/cairo-fill-rule.html +36 -0
- data/doc/en/cairo-filter.html +40 -0
- data/doc/en/cairo-font-extents.html +129 -0
- data/doc/en/cairo-font-face.html +38 -0
- data/doc/en/cairo-font-options.html +139 -0
- data/doc/en/cairo-font-slant.html +37 -0
- data/doc/en/cairo-font-type-mismatch.html +47 -0
- data/doc/en/cairo-font-weight.html +36 -0
- data/doc/en/cairo-format.html +46 -0
- data/doc/en/cairo-glyph.html +99 -0
- data/doc/en/cairo-gradient-pattern.html +74 -0
- data/doc/en/cairo-hint-metrics.html +37 -0
- data/doc/en/cairo-hint-style.html +39 -0
- data/doc/en/cairo-image-surface.html +82 -0
- data/doc/en/cairo-invalid-clusters.html +47 -0
- data/doc/en/cairo-invalid-content-error.html +47 -0
- data/doc/en/cairo-invalid-dash-error.html +47 -0
- data/doc/en/cairo-invalid-dsc-comment-error.html +47 -0
- data/doc/en/cairo-invalid-format-error.html +47 -0
- data/doc/en/cairo-invalid-index-error.html +47 -0
- data/doc/en/cairo-invalid-matrix-error.html +47 -0
- data/doc/en/cairo-invalid-path-data-error.html +47 -0
- data/doc/en/cairo-invalid-pop-group-error.html +47 -0
- data/doc/en/cairo-invalid-restore-error.html +47 -0
- data/doc/en/cairo-invalid-slant.html +47 -0
- data/doc/en/cairo-invalid-status-error.html +47 -0
- data/doc/en/cairo-invalid-stride-error.html +47 -0
- data/doc/en/cairo-invalid-string-error.html +47 -0
- data/doc/en/cairo-invalid-visual-error.html +47 -0
- data/doc/en/cairo-invalid-weight.html +47 -0
- data/doc/en/cairo-line-cap.html +37 -0
- data/doc/en/cairo-line-join.html +37 -0
- data/doc/en/cairo-linear-pattern.html +60 -0
- data/doc/en/cairo-matrix.html +259 -0
- data/doc/en/cairo-negative-count.html +47 -0
- data/doc/en/cairo-no-current-point-error.html +47 -0
- data/doc/en/cairo-null-pointer-error.html +47 -0
- data/doc/en/cairo-operator.html +48 -0
- data/doc/en/cairo-paper-parse-error.html +47 -0
- data/doc/en/cairo-paper-unknown-paper-name.html +66 -0
- data/doc/en/cairo-paper-unknown-unit.html +66 -0
- data/doc/en/cairo-paper-unrecognized-paper-description.html +66 -0
- data/doc/en/cairo-paper.html +184 -0
- data/doc/en/cairo-path-close-path.html +49 -0
- data/doc/en/cairo-path-curve-to.html +49 -0
- data/doc/en/cairo-path-data-type.html +38 -0
- data/doc/en/cairo-path-data.html +98 -0
- data/doc/en/cairo-path-line-to.html +49 -0
- data/doc/en/cairo-path-move-to.html +49 -0
- data/doc/en/cairo-path.html +155 -0
- data/doc/en/cairo-pattern-type-mismatch-error.html +47 -0
- data/doc/en/cairo-pattern.html +99 -0
- data/doc/en/cairo-pdf-surface.html +57 -0
- data/doc/en/cairo-point.html +74 -0
- data/doc/en/cairo-ps-level.html +49 -0
- data/doc/en/cairo-ps-surface.html +92 -0
- data/doc/en/cairo-quartz-image-surface.html +57 -0
- data/doc/en/cairo-quartz-surface.html +57 -0
- data/doc/en/cairo-radial-pattern.html +60 -0
- data/doc/en/cairo-read-error.html +47 -0
- data/doc/en/cairo-rectangle.html +89 -0
- data/doc/en/cairo-scaled-font.html +94 -0
- data/doc/en/cairo-solid-pattern.html +62 -0
- data/doc/en/cairo-subpixel-order.html +39 -0
- data/doc/en/cairo-surface-finished-error.html +47 -0
- data/doc/en/cairo-surface-pattern.html +57 -0
- data/doc/en/cairo-surface-type-mismatch-error.html +47 -0
- data/doc/en/cairo-surface.html +121 -0
- data/doc/en/cairo-svg-surface.html +77 -0
- data/doc/en/cairo-svg-version.html +49 -0
- data/doc/en/cairo-temp-file-error.html +47 -0
- data/doc/en/cairo-text-cluster-flag.html +35 -0
- data/doc/en/cairo-text-cluster.html +84 -0
- data/doc/en/cairo-text-extents.html +144 -0
- data/doc/en/cairo-toy-font-face.html +67 -0
- data/doc/en/cairo-user-font-error.html +47 -0
- data/doc/en/cairo-user-font-face-text-to-glyphs-data.html +94 -0
- data/doc/en/cairo-user-font-face.html +72 -0
- data/doc/en/cairo-user-font-immutable.html +47 -0
- data/doc/en/cairo-win32-printing-surface.html +57 -0
- data/doc/en/cairo-win32-surface.html +62 -0
- data/doc/en/cairo-write-error.html +47 -0
- data/doc/en/cairo.html +131 -0
- data/doc/en/index.html +1154 -0
- data/doc/index.html +18 -0
- data/doc/ja/cairo-antialias.html +57 -0
- data/doc/ja/cairo-clip-not-representable-error.html +56 -0
- data/doc/ja/cairo-color-base.html +75 -0
- data/doc/ja/cairo-color-cmyk.html +152 -0
- data/doc/ja/cairo-color-hsv.html +135 -0
- data/doc/ja/cairo-color-rgb.html +145 -0
- data/doc/ja/cairo-color-x11.html +183 -0
- data/doc/ja/cairo-color.html +317 -0
- data/doc/ja/cairo-content.html +51 -0
- data/doc/ja/cairo-context-blur.html +53 -0
- data/doc/ja/cairo-context-circle.html +54 -0
- data/doc/ja/cairo-context-color.html +52 -0
- data/doc/ja/cairo-context-path.html +77 -0
- data/doc/ja/cairo-context-rectangle.html +60 -0
- data/doc/ja/cairo-context-triangle.html +47 -0
- data/doc/ja/cairo-context.html +1542 -0
- data/doc/ja/cairo-error.html +56 -0
- data/doc/ja/cairo-extend.html +56 -0
- data/doc/ja/cairo-file-not-found.html +51 -0
- data/doc/ja/cairo-fill-rule.html +58 -0
- data/doc/ja/cairo-filter.html +43 -0
- data/doc/ja/cairo-font-extents.html +164 -0
- data/doc/ja/cairo-font-face.html +55 -0
- data/doc/ja/cairo-font-options.html +189 -0
- data/doc/ja/cairo-font-slant.html +50 -0
- data/doc/ja/cairo-font-type-mismatch.html +52 -0
- data/doc/ja/cairo-font-weight.html +47 -0
- data/doc/ja/cairo-format.html +81 -0
- data/doc/ja/cairo-glyph.html +115 -0
- data/doc/ja/cairo-gradient-pattern.html +119 -0
- data/doc/ja/cairo-hint-metrics.html +57 -0
- data/doc/ja/cairo-hint-style.html +64 -0
- data/doc/ja/cairo-image-surface.html +131 -0
- data/doc/ja/cairo-invalid-clusters.html +55 -0
- data/doc/ja/cairo-invalid-content-error.html +54 -0
- data/doc/ja/cairo-invalid-dash-error.html +54 -0
- data/doc/ja/cairo-invalid-dsc-comment-error.html +54 -0
- data/doc/ja/cairo-invalid-format-error.html +54 -0
- data/doc/ja/cairo-invalid-index-error.html +54 -0
- data/doc/ja/cairo-invalid-matrix-error.html +54 -0
- data/doc/ja/cairo-invalid-path-data-error.html +54 -0
- data/doc/ja/cairo-invalid-pop-group-error.html +54 -0
- data/doc/ja/cairo-invalid-restore-error.html +55 -0
- data/doc/ja/cairo-invalid-slant.html +57 -0
- data/doc/ja/cairo-invalid-status-error.html +55 -0
- data/doc/ja/cairo-invalid-stride-error.html +55 -0
- data/doc/ja/cairo-invalid-string-error.html +54 -0
- data/doc/ja/cairo-invalid-visual-error.html +57 -0
- data/doc/ja/cairo-invalid-weight.html +57 -0
- data/doc/ja/cairo-line-cap.html +50 -0
- data/doc/ja/cairo-line-join.html +53 -0
- data/doc/ja/cairo-linear-pattern.html +87 -0
- data/doc/ja/cairo-matrix.html +354 -0
- data/doc/ja/cairo-negative-count.html +52 -0
- data/doc/ja/cairo-no-current-point-error.html +54 -0
- data/doc/ja/cairo-null-pointer-error.html +54 -0
- data/doc/ja/cairo-operator.html +51 -0
- data/doc/ja/cairo-paper-parse-error.html +55 -0
- data/doc/ja/cairo-paper-unknown-paper-name.html +76 -0
- data/doc/ja/cairo-paper-unknown-unit.html +75 -0
- data/doc/ja/cairo-paper-unrecognized-paper-description.html +76 -0
- data/doc/ja/cairo-paper.html +357 -0
- data/doc/ja/cairo-path-close-path.html +57 -0
- data/doc/ja/cairo-path-curve-to.html +70 -0
- data/doc/ja/cairo-path-data-type.html +53 -0
- data/doc/ja/cairo-path-data.html +127 -0
- data/doc/ja/cairo-path-line-to.html +62 -0
- data/doc/ja/cairo-path-move-to.html +62 -0
- data/doc/ja/cairo-path.html +144 -0
- data/doc/ja/cairo-pattern-type-mismatch-error.html +56 -0
- data/doc/ja/cairo-pattern.html +128 -0
- data/doc/ja/cairo-pdf-surface.html +86 -0
- data/doc/ja/cairo-point.html +90 -0
- data/doc/ja/cairo-ps-level.html +62 -0
- data/doc/ja/cairo-ps-surface.html +214 -0
- data/doc/ja/cairo-quartz-image-surface.html +75 -0
- data/doc/ja/cairo-quartz-surface.html +93 -0
- data/doc/ja/cairo-radial-pattern.html +93 -0
- data/doc/ja/cairo-read-error.html +55 -0
- data/doc/ja/cairo-rectangle.html +109 -0
- data/doc/ja/cairo-scaled-font.html +180 -0
- data/doc/ja/cairo-solid-pattern.html +87 -0
- data/doc/ja/cairo-subpixel-order.html +57 -0
- data/doc/ja/cairo-surface-finished-error.html +54 -0
- data/doc/ja/cairo-surface-pattern.html +68 -0
- data/doc/ja/cairo-surface-type-mismatch-error.html +56 -0
- data/doc/ja/cairo-surface.html +213 -0
- data/doc/ja/cairo-svg-surface.html +114 -0
- data/doc/ja/cairo-svg-version.html +66 -0
- data/doc/ja/cairo-temp-file-error.html +50 -0
- data/doc/ja/cairo-text-cluster-flag.html +46 -0
- data/doc/ja/cairo-text-cluster.html +102 -0
- data/doc/ja/cairo-text-extents.html +163 -0
- data/doc/ja/cairo-toy-font-face.html +107 -0
- data/doc/ja/cairo-user-font-error.html +55 -0
- data/doc/ja/cairo-user-font-face-text-to-glyphs-data.html +156 -0
- data/doc/ja/cairo-user-font-face.html +268 -0
- data/doc/ja/cairo-user-font-immutable.html +54 -0
- data/doc/ja/cairo-win32-printing-surface.html +80 -0
- data/doc/ja/cairo-win32-surface.html +100 -0
- data/doc/ja/cairo-write-error.html +55 -0
- data/doc/ja/cairo.html +177 -0
- data/doc/ja/index.html +1156 -0
- data/ext/cairo/cairo.def +104 -0
- data/ext/cairo/extconf.rb +80 -0
- data/ext/cairo/rb_cairo.c +104 -0
- data/ext/cairo/rb_cairo.h +275 -0
- data/ext/cairo/rb_cairo_constants.c +478 -0
- data/ext/cairo/rb_cairo_context.c +1693 -0
- data/ext/cairo/rb_cairo_exception.c +354 -0
- data/ext/cairo/rb_cairo_font_extents.c +200 -0
- data/ext/cairo/rb_cairo_font_face.c +713 -0
- data/ext/cairo/rb_cairo_font_options.c +197 -0
- data/ext/cairo/rb_cairo_glyph.c +161 -0
- data/ext/cairo/rb_cairo_matrix.c +366 -0
- data/ext/cairo/rb_cairo_path.c +459 -0
- data/ext/cairo/rb_cairo_pattern.c +540 -0
- data/ext/cairo/rb_cairo_private.c +242 -0
- data/ext/cairo/rb_cairo_private.h +114 -0
- data/ext/cairo/rb_cairo_scaled_font.c +235 -0
- data/ext/cairo/rb_cairo_surface.c +1371 -0
- data/ext/cairo/rb_cairo_text_cluster.c +151 -0
- data/ext/cairo/rb_cairo_text_extents.c +221 -0
- data/extconf.rb +45 -0
- data/lib/1.8/cairo.so +0 -0
- data/lib/1.9/cairo.so +0 -0
- data/lib/cairo.rb +151 -0
- data/lib/cairo/color.rb +267 -0
- data/lib/cairo/colors.rb +656 -0
- data/lib/cairo/constants.rb +24 -0
- data/lib/cairo/context.rb +29 -0
- data/lib/cairo/context/blur.rb +45 -0
- data/lib/cairo/context/circle.rb +9 -0
- data/lib/cairo/context/color.rb +11 -0
- data/lib/cairo/context/path.rb +116 -0
- data/lib/cairo/context/rectangle.rb +33 -0
- data/lib/cairo/context/triangle.rb +12 -0
- data/lib/cairo/paper.rb +183 -0
- data/lib/cairo/papers.rb +41 -0
- data/lib/cairo/path.rb +15 -0
- data/lib/cairo/point.rb +7 -0
- data/misc/update-colors.rb +143 -0
- data/pkg-config.rb +313 -0
- data/samples/agg/README +4 -0
- data/samples/agg/aa_test.rb +304 -0
- data/samples/blur.rb +47 -0
- data/samples/pac.rb +99 -0
- data/samples/pac2.rb +171 -0
- data/samples/png.rb +45 -0
- data/samples/scalable.rb +56 -0
- data/samples/text-on-path.rb +60 -0
- data/samples/text2.rb +131 -0
- data/test-unit/Rakefile +30 -0
- data/test-unit/bin/testrb +5 -0
- data/test-unit/lib/test/unit.rb +280 -0
- data/test-unit/lib/test/unit/assertionfailederror.rb +14 -0
- data/test-unit/lib/test/unit/assertions.rb +722 -0
- data/test-unit/lib/test/unit/attribute.rb +125 -0
- data/test-unit/lib/test/unit/autorunner.rb +254 -0
- data/test-unit/lib/test/unit/collector.rb +43 -0
- data/test-unit/lib/test/unit/collector/descendant.rb +23 -0
- data/test-unit/lib/test/unit/collector/dir.rb +108 -0
- data/test-unit/lib/test/unit/collector/load.rb +135 -0
- data/test-unit/lib/test/unit/collector/objectspace.rb +34 -0
- data/test-unit/lib/test/unit/color.rb +61 -0
- data/test-unit/lib/test/unit/diff.rb +524 -0
- data/test-unit/lib/test/unit/error.rb +124 -0
- data/test-unit/lib/test/unit/exceptionhandler.rb +39 -0
- data/test-unit/lib/test/unit/failure.rb +110 -0
- data/test-unit/lib/test/unit/fixture.rb +185 -0
- data/test-unit/lib/test/unit/notification.rb +125 -0
- data/test-unit/lib/test/unit/omission.rb +143 -0
- data/test-unit/lib/test/unit/pending.rb +146 -0
- data/test-unit/lib/test/unit/priority.rb +146 -0
- data/test-unit/lib/test/unit/runner/console.rb +46 -0
- data/test-unit/lib/test/unit/runner/emacs.rb +8 -0
- data/test-unit/lib/test/unit/testcase.rb +281 -0
- data/test-unit/lib/test/unit/testresult.rb +89 -0
- data/test-unit/lib/test/unit/testsuite.rb +110 -0
- data/test-unit/lib/test/unit/ui/console/outputlevel.rb +14 -0
- data/test-unit/lib/test/unit/ui/console/testrunner.rb +195 -0
- data/test-unit/lib/test/unit/ui/emacs/testrunner.rb +49 -0
- data/test-unit/lib/test/unit/ui/testrunner.rb +20 -0
- data/test-unit/lib/test/unit/ui/testrunnermediator.rb +77 -0
- data/test-unit/lib/test/unit/ui/testrunnerutilities.rb +41 -0
- data/test-unit/lib/test/unit/util/backtracefilter.rb +41 -0
- data/test-unit/lib/test/unit/util/observable.rb +90 -0
- data/test-unit/lib/test/unit/util/procwrapper.rb +48 -0
- data/test-unit/lib/test/unit/version.rb +7 -0
- data/test-unit/sample/adder.rb +13 -0
- data/test-unit/sample/subtracter.rb +12 -0
- data/test-unit/sample/tc_adder.rb +18 -0
- data/test-unit/sample/tc_subtracter.rb +18 -0
- data/test-unit/sample/ts_examples.rb +7 -0
- data/test-unit/test/collector/test_descendant.rb +135 -0
- data/test-unit/test/collector/test_dir.rb +406 -0
- data/test-unit/test/collector/test_load.rb +333 -0
- data/test-unit/test/collector/test_objectspace.rb +98 -0
- data/test-unit/test/run-test.rb +13 -0
- data/test-unit/test/test_assertions.rb +693 -0
- data/test-unit/test/test_attribute.rb +86 -0
- data/test-unit/test/test_color.rb +37 -0
- data/test-unit/test/test_diff.rb +477 -0
- data/test-unit/test/test_emacs_runner.rb +60 -0
- data/test-unit/test/test_error.rb +26 -0
- data/test-unit/test/test_failure.rb +33 -0
- data/test-unit/test/test_fixture.rb +252 -0
- data/test-unit/test/test_notification.rb +33 -0
- data/test-unit/test/test_omission.rb +81 -0
- data/test-unit/test/test_pending.rb +70 -0
- data/test-unit/test/test_priority.rb +89 -0
- data/test-unit/test/test_testcase.rb +430 -0
- data/test-unit/test/test_testresult.rb +113 -0
- data/test-unit/test/test_testsuite.rb +129 -0
- data/test-unit/test/testunit_test_util.rb +14 -0
- data/test-unit/test/ui/test_testrunmediator.rb +20 -0
- data/test-unit/test/util/test_backtracefilter.rb +41 -0
- data/test-unit/test/util/test_observable.rb +102 -0
- data/test-unit/test/util/test_procwrapper.rb +36 -0
- data/test/cairo-test-utils.rb +18 -0
- data/test/run-test.rb +28 -0
- data/test/test_color.rb +17 -0
- data/test/test_constants.rb +16 -0
- data/test/test_context.rb +105 -0
- data/test/test_exception.rb +27 -0
- data/test/test_font_extents.rb +36 -0
- data/test/test_font_face.rb +244 -0
- data/test/test_font_options.rb +13 -0
- data/test/test_paper.rb +81 -0
- data/test/test_pkg_config.rb +123 -0
- data/test/test_scaled_font.rb +34 -0
- data/test/test_surface.rb +41 -0
- data/test/test_text_cluster.rb +32 -0
- data/test/test_text_extents.rb +40 -0
- data/test/test_text_to_glyphs_data.rb +51 -0
- data/tmp/x86-mingw32/cairo/1.8.7/fake.rb +6 -0
- data/tmp/x86-mingw32/cairo/1.8.7/mkmf.rb +1836 -0
- data/tmp/x86-mingw32/cairo/1.8.7/rbconfig.rb +183 -0
- data/tmp/x86-mingw32/cairo/1.9.2/fake.rb +6 -0
- data/tmp/x86-mingw32/cairo/1.9.2/mkmf.rb +2079 -0
- data/tmp/x86-mingw32/cairo/1.9.2/rbconfig.rb +226 -0
- metadata +437 -0
data/lib/cairo/color.rb
ADDED
@@ -0,0 +1,267 @@
|
|
1
|
+
module Cairo
|
2
|
+
module Color
|
3
|
+
module_function
|
4
|
+
def parse(value, robust=false)
|
5
|
+
return value.dup if value.is_a?(Base)
|
6
|
+
case value
|
7
|
+
when Array
|
8
|
+
case value.first
|
9
|
+
when :cmyk, :cmyka
|
10
|
+
CMYK.new(*value[1..-1])
|
11
|
+
when :hsv, :hsva
|
12
|
+
HSV.new(*value[1..-1])
|
13
|
+
else
|
14
|
+
type, *value = value if [:rgb, :rgba].include?(value.first)
|
15
|
+
RGB.new(*value)
|
16
|
+
end
|
17
|
+
when /\A#/ #
|
18
|
+
parse_hex_color(value)
|
19
|
+
when String, Symbol
|
20
|
+
name = Cairo.normalize_const_name(value)
|
21
|
+
begin
|
22
|
+
const_get(name).dup
|
23
|
+
rescue NameError
|
24
|
+
raise ArgumentError, "unknown color name: #{value}"
|
25
|
+
end
|
26
|
+
else
|
27
|
+
if robust
|
28
|
+
raise ArgumentError, "can't parse as color name: #{value.inspect}"
|
29
|
+
end
|
30
|
+
value
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
HEX_RE = "(?i:[a-f\\d])"
|
35
|
+
def parse_hex_color(value)
|
36
|
+
case value
|
37
|
+
when /\A#((?:#{HEX_RE}){3,4})\z/ #
|
38
|
+
RGB.new(*$1.scan(/./).collect {|value| value.hex / 15.0})
|
39
|
+
when /\A#((?:#{HEX_RE}{2,2}){3,4})\z/ #
|
40
|
+
RGB.new(*$1.scan(/.{2,2}/).collect {|value| value.hex / 255.0})
|
41
|
+
when /\A#((?:#{HEX_RE}{4,4}){3,4})\z/ #
|
42
|
+
RGB.new(*$1.scan(/.{4,4}/).collect {|value| value.hex / 65535.0})
|
43
|
+
else
|
44
|
+
message = "invalid hex color format: #{value} should be "
|
45
|
+
message << "#RGB, #RGBA, #RRGGBB, #RRGGBBAA, #RRRRGGGGBBBB "
|
46
|
+
message << "or #RRRRGGGGBBBBAAAA"
|
47
|
+
raise ArgumentError, message
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
class Base
|
52
|
+
attr_accessor :alpha
|
53
|
+
|
54
|
+
alias_method :a, :alpha
|
55
|
+
alias_method :a=, :alpha=
|
56
|
+
|
57
|
+
def initialize(a)
|
58
|
+
assert_in_range(a, "alpha channel")
|
59
|
+
@alpha = a
|
60
|
+
end
|
61
|
+
|
62
|
+
private
|
63
|
+
def assert_in_range(value, description)
|
64
|
+
unless (0.0..1.0).include?(value)
|
65
|
+
raise ArgumentError,
|
66
|
+
"#{description} value should be in [0.0, 1.0]: #{value.inspect}"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
class RGB < Base
|
72
|
+
attr_accessor :red, :green, :blue
|
73
|
+
|
74
|
+
alias_method :r, :red
|
75
|
+
alias_method :r=, :red=
|
76
|
+
alias_method :g, :green
|
77
|
+
alias_method :g=, :green=
|
78
|
+
alias_method :b, :blue
|
79
|
+
alias_method :b=, :blue=
|
80
|
+
|
81
|
+
def initialize(r, g, b, a=1.0)
|
82
|
+
super(a)
|
83
|
+
assert_in_range(r, "red")
|
84
|
+
assert_in_range(g, "green")
|
85
|
+
assert_in_range(b, "blue")
|
86
|
+
@red = r
|
87
|
+
@green = g
|
88
|
+
@blue = b
|
89
|
+
end
|
90
|
+
|
91
|
+
def hash
|
92
|
+
to_s.hash
|
93
|
+
end
|
94
|
+
|
95
|
+
def eql?(other)
|
96
|
+
self == other
|
97
|
+
end
|
98
|
+
|
99
|
+
def ==(other)
|
100
|
+
other.is_a?(self.class) and other.to_s == to_s
|
101
|
+
end
|
102
|
+
|
103
|
+
def to_a
|
104
|
+
[@red, @green, @blue, @alpha]
|
105
|
+
end
|
106
|
+
alias_method :to_ary, :to_a
|
107
|
+
|
108
|
+
def to_s
|
109
|
+
"#%02X%02X%02X%02X" % to_a.collect {|v| (v * 255).ceil}
|
110
|
+
end
|
111
|
+
|
112
|
+
def to_rgb
|
113
|
+
clone
|
114
|
+
end
|
115
|
+
|
116
|
+
def to_cmyk
|
117
|
+
cmy = [1.0 - @red, 1.0 - @green, 1.0 - @blue]
|
118
|
+
key_plate = cmy.min
|
119
|
+
if key_plate < 1.0
|
120
|
+
one_k = 1.0 - key_plate
|
121
|
+
cmyk = cmy.collect {|value| (value - key_plate) / one_k} + [key_plate]
|
122
|
+
else
|
123
|
+
cmyk = [0, 0, 0, key_plate]
|
124
|
+
end
|
125
|
+
cmyka = cmyk + [@alpha]
|
126
|
+
CMYK.new(*cmyka)
|
127
|
+
end
|
128
|
+
|
129
|
+
def to_hsv
|
130
|
+
max = [@red, @blue, @green].max
|
131
|
+
if max > 0
|
132
|
+
min = [@red, @blue, @green].min
|
133
|
+
max_min = max - min
|
134
|
+
case max
|
135
|
+
when @red
|
136
|
+
numerator = @green - @blue
|
137
|
+
angle = 0
|
138
|
+
when @green
|
139
|
+
numerator = @blue - @red
|
140
|
+
angle = 120
|
141
|
+
when @blue
|
142
|
+
numerator = @red - @green
|
143
|
+
angle = 240
|
144
|
+
end
|
145
|
+
h = max_min > 0 ? 60 * numerator / max_min + angle : 0.0
|
146
|
+
s = max_min / max
|
147
|
+
else
|
148
|
+
h = 0.0
|
149
|
+
s = 0.0
|
150
|
+
end
|
151
|
+
v = max
|
152
|
+
HSV.new(h, s, v, @alpha)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
class CMYK < Base
|
157
|
+
attr_accessor :cyan, :magenta, :yellow, :key_plate
|
158
|
+
|
159
|
+
alias_method :c, :cyan
|
160
|
+
alias_method :c=, :cyan=
|
161
|
+
alias_method :m, :magenta
|
162
|
+
alias_method :m=, :magenta=
|
163
|
+
alias_method :y, :yellow
|
164
|
+
alias_method :y=, :yellow=
|
165
|
+
alias_method :k, :key_plate
|
166
|
+
alias_method :k=, :key_plate=
|
167
|
+
|
168
|
+
def initialize(c, m, y, k, a=1.0)
|
169
|
+
super(a)
|
170
|
+
assert_in_range(c, "cyan")
|
171
|
+
assert_in_range(m, "magenta")
|
172
|
+
assert_in_range(y, "yellow")
|
173
|
+
assert_in_range(k, "key plate")
|
174
|
+
@cyan = c
|
175
|
+
@magenta = m
|
176
|
+
@yellow = y
|
177
|
+
@key_plate = k
|
178
|
+
end
|
179
|
+
|
180
|
+
def to_a
|
181
|
+
[@cyan, @magenta, @yellow, @key_plate, @alpha]
|
182
|
+
end
|
183
|
+
alias_method :to_ary, :to_a
|
184
|
+
|
185
|
+
def to_rgb
|
186
|
+
one_k = 1.0 - @key_plate
|
187
|
+
rgba = [
|
188
|
+
(1.0 - @cyan) * one_k,
|
189
|
+
(1.0 - @magenta) * one_k,
|
190
|
+
(1.0 - @yellow) * one_k,
|
191
|
+
@alpha,
|
192
|
+
]
|
193
|
+
RGB.new(*rgba)
|
194
|
+
end
|
195
|
+
|
196
|
+
def to_cmyk
|
197
|
+
clone
|
198
|
+
end
|
199
|
+
|
200
|
+
def to_hsv
|
201
|
+
to_rgb.to_hsv
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
class HSV < Base
|
206
|
+
attr_accessor :hue, :saturation, :value
|
207
|
+
|
208
|
+
alias_method :h, :hue
|
209
|
+
alias_method :h=, :hue=
|
210
|
+
alias_method :s, :saturation
|
211
|
+
alias_method :s=, :saturation=
|
212
|
+
alias_method :v, :value
|
213
|
+
alias_method :v=, :value=
|
214
|
+
|
215
|
+
def initialize(h, s, v, a=1.0)
|
216
|
+
super(a)
|
217
|
+
assert_in_range(s, "saturation")
|
218
|
+
assert_in_range(v, "value")
|
219
|
+
@hue = h.modulo(360.0)
|
220
|
+
@saturation = s
|
221
|
+
@value = v
|
222
|
+
end
|
223
|
+
|
224
|
+
def to_a
|
225
|
+
[@hue, @saturation, @value, @alpha]
|
226
|
+
end
|
227
|
+
alias_method :to_ary, :to_a
|
228
|
+
|
229
|
+
def to_rgb
|
230
|
+
if s > 0
|
231
|
+
h_60 = @hue / 60.0
|
232
|
+
hi = h_60.floor.modulo(6)
|
233
|
+
f = h_60 - hi
|
234
|
+
p = @value * (1 - @saturation)
|
235
|
+
q = @value * (1 - f * @saturation)
|
236
|
+
t = @value * (1 - (1 - f) * @saturation)
|
237
|
+
case hi
|
238
|
+
when 0
|
239
|
+
rgb = [@value, t, p]
|
240
|
+
when 1
|
241
|
+
rgb = [q, @value, p]
|
242
|
+
when 2
|
243
|
+
rgb = [p, @value, t]
|
244
|
+
when 3
|
245
|
+
rgb = [p, q, @value]
|
246
|
+
when 4
|
247
|
+
rgb = [t, p, @value]
|
248
|
+
when 5
|
249
|
+
rgb = [@value, p, q]
|
250
|
+
end
|
251
|
+
rgba = rgb + [@alpha]
|
252
|
+
RGB.new(*rgba)
|
253
|
+
else
|
254
|
+
RGB.new(@value, @value, @value, @alpha)
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
def to_cmyk
|
259
|
+
to_rgb.to_cmyk
|
260
|
+
end
|
261
|
+
|
262
|
+
def to_hsv
|
263
|
+
clone
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
267
|
+
end
|
data/lib/cairo/colors.rb
ADDED
@@ -0,0 +1,656 @@
|
|
1
|
+
require 'cairo/color'
|
2
|
+
|
3
|
+
module Cairo
|
4
|
+
module Color
|
5
|
+
# Alice Blue: #F0F8FF
|
6
|
+
ALICE_BLUE = RGB.new(0.941176470588235, 0.972549019607843, 1.0)
|
7
|
+
# Alizarin Crimson: #E32636
|
8
|
+
ALIZARIN_CRIMSON = RGB.new(0.890196078431372, 0.149019607843137, 0.211764705882353)
|
9
|
+
# Amaranth: #E52B50
|
10
|
+
AMARANTH = RGB.new(0.898039215686275, 0.168627450980392, 0.313725490196078)
|
11
|
+
# Amber: #FFBF00
|
12
|
+
AMBER = RGB.new(1.0, 0.749019607843137, 0.0)
|
13
|
+
# Amethyst: #9966CC
|
14
|
+
AMETHYST = RGB.new(0.6, 0.4, 0.8)
|
15
|
+
# Apricot: #FBCEB1
|
16
|
+
APRICOT = RGB.new(0.984313725490196, 0.807843137254902, 0.694117647058824)
|
17
|
+
# Aqua: #00FFFF
|
18
|
+
AQUA = RGB.new(0.0, 1.0, 1.0)
|
19
|
+
# Aquamarine: #7FFFD4
|
20
|
+
AQUAMARINE = RGB.new(0.498039215686275, 1.0, 0.831372549019608)
|
21
|
+
# Asparagus: #7BA05B
|
22
|
+
ASPARAGUS = RGB.new(0.482352941176471, 0.627450980392157, 0.356862745098039)
|
23
|
+
# Azure: #007FFF
|
24
|
+
AZURE = RGB.new(0.0, 0.498039215686275, 1.0)
|
25
|
+
# Beige: #F5F5DC
|
26
|
+
BEIGE = RGB.new(0.96078431372549, 0.96078431372549, 0.862745098039216)
|
27
|
+
# Bistre: #3D2B1F
|
28
|
+
BISTRE = RGB.new(0.23921568627451, 0.168627450980392, 0.12156862745098)
|
29
|
+
# Black: #000000
|
30
|
+
BLACK = RGB.new(0.0, 0.0, 0.0)
|
31
|
+
# Blue: #0000FF
|
32
|
+
BLUE = RGB.new(0.0, 0.0, 1.0)
|
33
|
+
# Bondi Blue: #0095B6
|
34
|
+
BONDI_BLUE = RGB.new(0.0, 0.584313725490196, 0.713725490196078)
|
35
|
+
# Bright green: #66FF00
|
36
|
+
BRIGHT_GREEN = RGB.new(0.4, 1.0, 0.0)
|
37
|
+
# Bright turquoise: #08E8DE
|
38
|
+
BRIGHT_TURQUOISE = RGB.new(0.0313725490196078, 0.909803921568627, 0.870588235294118)
|
39
|
+
# Brown: #964B00
|
40
|
+
BROWN = RGB.new(0.588235294117647, 0.294117647058824, 0.0)
|
41
|
+
# Buff: #F0DC82
|
42
|
+
BUFF = RGB.new(0.941176470588235, 0.862745098039216, 0.509803921568627)
|
43
|
+
# Burgundy: #900020
|
44
|
+
BURGUNDY = RGB.new(0.501960784313725, 0.0, 0.125490196078431)
|
45
|
+
# Burnt Orange: #CC5500
|
46
|
+
BURNT_ORANGE = RGB.new(0.8, 0.333333333333333, 0.0)
|
47
|
+
# Burnt Sienna: #E97451
|
48
|
+
BURNT_SIENNA = RGB.new(0.913725490196078, 0.454901960784314, 0.317647058823529)
|
49
|
+
# Burnt umber: #8A3324
|
50
|
+
BURNT_UMBER = RGB.new(0.541176470588235, 0.2, 0.141176470588235)
|
51
|
+
# Camouflage green: #78866B
|
52
|
+
CAMOUFLAGE_GREEN = RGB.new(0.470588235294118, 0.525490196078431, 0.419607843137255)
|
53
|
+
# Cardinal: #C41E3A
|
54
|
+
CARDINAL = RGB.new(0.768627450980392, 0.117647058823529, 0.227450980392157)
|
55
|
+
# Carmine: #960018
|
56
|
+
CARMINE = RGB.new(0.588235294117647, 0.0, 0.0941176470588235)
|
57
|
+
# Carnation: #F95A61
|
58
|
+
CARNATION = RGB.new(0.976470588235294, 0.352941176470588, 0.380392156862745)
|
59
|
+
# Carrot orange: #ED9121
|
60
|
+
CARROT_ORANGE = RGB.new(0.929411764705882, 0.568627450980392, 0.129411764705882)
|
61
|
+
# Celadon: #ACE1AF
|
62
|
+
CELADON = RGB.new(0.674509803921569, 0.882352941176471, 0.686274509803922)
|
63
|
+
# Cerise: #DE3163
|
64
|
+
CERISE = RGB.new(0.870588235294118, 0.192156862745098, 0.388235294117647)
|
65
|
+
# Cerulean: #007BA7
|
66
|
+
CERULEAN = RGB.new(0.0, 0.482352941176471, 0.654901960784314)
|
67
|
+
# Cerulean blue: #2A52BE
|
68
|
+
CERULEAN_BLUE = RGB.new(0.164705882352941, 0.32156862745098, 0.745098039215686)
|
69
|
+
# Chartreuse: #7FFF00
|
70
|
+
CHARTREUSE = RGB.new(0.498039215686275, 1.0, 0.0)
|
71
|
+
# Chartreuse yellow: #DFFF00
|
72
|
+
CHARTREUSE_YELLOW = RGB.new(0.874509803921569, 1.0, 0.0)
|
73
|
+
# Chestnut: #CD5C5C
|
74
|
+
CHESTNUT = RGB.new(0.803921568627451, 0.36078431372549, 0.36078431372549)
|
75
|
+
# Chocolate: #D2691E
|
76
|
+
CHOCOLATE = RGB.new(0.823529411764706, 0.411764705882353, 0.117647058823529)
|
77
|
+
# Cinnamon: #7B3F00
|
78
|
+
CINNAMON = RGB.new(0.482352941176471, 0.247058823529412, 0.0)
|
79
|
+
# Cobalt: #0047AB
|
80
|
+
COBALT = RGB.new(0.0, 0.27843137254902, 0.670588235294118)
|
81
|
+
# Copper: #B87333
|
82
|
+
COPPER = RGB.new(0.72156862745098, 0.450980392156863, 0.2)
|
83
|
+
# Copper rose: #996666
|
84
|
+
COPPER_ROSE = RGB.new(0.6, 0.4, 0.4)
|
85
|
+
# Coral: #FF7F50
|
86
|
+
CORAL = RGB.new(1.0, 0.498039215686275, 0.313725490196078)
|
87
|
+
# Coral Red: #FF4040
|
88
|
+
CORAL_RED = RGB.new(1.0, 0.250980392156863, 0.250980392156863)
|
89
|
+
# Corn: #FBEC5D
|
90
|
+
CORN = RGB.new(0.984313725490196, 0.925490196078431, 0.364705882352941)
|
91
|
+
# Cornflower blue: #6495ED
|
92
|
+
CORNFLOWER_BLUE = RGB.new(0.392156862745098, 0.584313725490196, 0.929411764705882)
|
93
|
+
# Cream: #FFFDD0
|
94
|
+
CREAM = RGB.new(1.0, 0.992156862745098, 0.815686274509804)
|
95
|
+
# Crimson: #DC143C
|
96
|
+
CRIMSON = RGB.new(0.862745098039216, 0.0784313725490196, 0.235294117647059)
|
97
|
+
# Cyan: #00FFFF
|
98
|
+
CYAN = RGB.new(0.0, 1.0, 1.0)
|
99
|
+
# Dark blue: #0000C8
|
100
|
+
DARK_BLUE = RGB.new(0.0, 0.0, 0.545098039215686)
|
101
|
+
# Denim: #1560BD
|
102
|
+
DENIM = RGB.new(0.0823529411764706, 0.376470588235294, 0.741176470588235)
|
103
|
+
# Dodger blue: #1E90FF
|
104
|
+
DODGER_BLUE = RGB.new(0.117647058823529, 0.564705882352941, 1.0)
|
105
|
+
# Emerald: #50C878
|
106
|
+
EMERALD = RGB.new(0.313725490196078, 0.784313725490196, 0.470588235294118)
|
107
|
+
# Eggplant: #990066
|
108
|
+
EGGPLANT = RGB.new(0.6, 0.0, 0.4)
|
109
|
+
# Falu red: #801818
|
110
|
+
FALU_RED = RGB.new(0.501960784313725, 0.0941176470588235, 0.0941176470588235)
|
111
|
+
# Fern green: #4F7942
|
112
|
+
FERN_GREEN = RGB.new(0.309803921568627, 0.474509803921569, 0.258823529411765)
|
113
|
+
# Flax: #EEDC82
|
114
|
+
FLAX = RGB.new(0.933333333333333, 0.862745098039216, 0.509803921568627)
|
115
|
+
# Forest green: #228B22
|
116
|
+
FOREST_GREEN = RGB.new(0.133333333333333, 0.545098039215686, 0.133333333333333)
|
117
|
+
# French Rose: #F64A8A
|
118
|
+
FRENCH_ROSE = RGB.new(0.964705882352941, 0.290196078431373, 0.541176470588235)
|
119
|
+
# Fuchsia: #FF00FF
|
120
|
+
FUCHSIA = RGB.new(1.0, 0.0, 1.0)
|
121
|
+
# Gamboge: #E49B0F
|
122
|
+
GAMBOGE = RGB.new(0.894117647058824, 0.607843137254902, 0.0588235294117647)
|
123
|
+
# Gold: #FFD700
|
124
|
+
GOLD = RGB.new(1.0, 0.843137254901961, 0.0)
|
125
|
+
# Goldenrod: #DAA520
|
126
|
+
GOLDENROD = RGB.new(0.854901960784314, 0.647058823529412, 0.125490196078431)
|
127
|
+
# Gray: #808080
|
128
|
+
GRAY = RGB.new(0.501960784313725, 0.501960784313725, 0.501960784313725)
|
129
|
+
# Gray-asparagus: #465945
|
130
|
+
GRAY_ASPARAGUS = RGB.new(0.274509803921569, 0.349019607843137, 0.270588235294118)
|
131
|
+
# Green: #00FF00
|
132
|
+
GREEN = RGB.new(0.0, 1.0, 0.0)
|
133
|
+
# Green-yellow: #ADFF2F
|
134
|
+
GREEN_YELLOW = RGB.new(0.67843137254902, 1.0, 0.184313725490196)
|
135
|
+
# Harlequin: #3FFF00
|
136
|
+
HARLEQUIN = RGB.new(0.247058823529412, 1.0, 0.0)
|
137
|
+
# Heliotrope: #DF73FF
|
138
|
+
HELIOTROPE = RGB.new(0.874509803921569, 0.450980392156863, 1.0)
|
139
|
+
# Hollywood Cerise: #F400A1
|
140
|
+
HOLLYWOOD_CERISE = RGB.new(0.956862745098039, 0.0, 0.631372549019608)
|
141
|
+
# Hot Magenta: #FF00CC
|
142
|
+
HOT_MAGENTA = RGB.new(1.0, 0.0, 0.8)
|
143
|
+
# Hot Pink: #FF69B4
|
144
|
+
HOT_PINK = RGB.new(1.0, 0.411764705882353, 0.705882352941177)
|
145
|
+
# Indigo: #4B0082
|
146
|
+
INDIGO = RGB.new(0.294117647058824, 0.0, 0.509803921568627)
|
147
|
+
# International Klein Blue: #002FA7
|
148
|
+
INTERNATIONAL_KLEIN_BLUE = RGB.new(0.0, 0.184313725490196, 0.654901960784314)
|
149
|
+
# International orange: #FF4F00
|
150
|
+
INTERNATIONAL_ORANGE = RGB.new(1.0, 0.309803921568627, 0.0)
|
151
|
+
# Ivory: #FFFFF0
|
152
|
+
IVORY = RGB.new(1.0, 1.0, 0.941176470588235)
|
153
|
+
# Jade: #00A86B
|
154
|
+
JADE = RGB.new(0.0, 0.658823529411765, 0.419607843137255)
|
155
|
+
# Khaki: #C3B091
|
156
|
+
KHAKI = RGB.new(0.764705882352941, 0.690196078431373, 0.568627450980392)
|
157
|
+
# Khaki (X11): #F0E68C
|
158
|
+
KHAKI_X11 = RGB.new(0.941176470588235, 0.901960784313726, 0.549019607843137)
|
159
|
+
# Lavender: #B57EDC
|
160
|
+
LAVENDER = RGB.new(0.709803921568627, 0.494117647058824, 0.862745098039216)
|
161
|
+
# Lavender blue: #CCCCFF
|
162
|
+
LAVENDER_BLUE = RGB.new(0.8, 0.8, 1.0)
|
163
|
+
# Lavender blush: #FFF0F5
|
164
|
+
LAVENDER_BLUSH = RGB.new(1.0, 0.941176470588235, 0.96078431372549)
|
165
|
+
# Lavender gray: #BDBBD7
|
166
|
+
LAVENDER_GRAY = RGB.new(0.741176470588235, 0.733333333333333, 0.843137254901961)
|
167
|
+
# Lavender pink: #FBAED2
|
168
|
+
LAVENDER_PINK = RGB.new(0.984313725490196, 0.682352941176471, 0.823529411764706)
|
169
|
+
# Lavender rose: #FBA0E3
|
170
|
+
LAVENDER_ROSE = RGB.new(0.984313725490196, 0.627450980392157, 0.890196078431372)
|
171
|
+
# Lemon: #FDE910
|
172
|
+
LEMON = RGB.new(0.992156862745098, 0.913725490196078, 0.0627450980392157)
|
173
|
+
# Lemon chiffon: #FFFACD
|
174
|
+
LEMON_CHIFFON = RGB.new(1.0, 0.980392156862745, 0.803921568627451)
|
175
|
+
# Lilac: #C8A2C8
|
176
|
+
LILAC = RGB.new(0.784313725490196, 0.635294117647059, 0.784313725490196)
|
177
|
+
# Lime: #BFFF00
|
178
|
+
LIME = RGB.new(0.749019607843137, 1.0, 0.0)
|
179
|
+
# Linen: #FAF0E6
|
180
|
+
LINEN = RGB.new(0.980392156862745, 0.941176470588235, 0.901960784313726)
|
181
|
+
# Magenta: #FF00FF
|
182
|
+
MAGENTA = RGB.new(1.0, 0.0, 1.0)
|
183
|
+
# Malachite: #0BDA51
|
184
|
+
MALACHITE = RGB.new(0.0431372549019608, 0.854901960784314, 0.317647058823529)
|
185
|
+
# Maroon: #800000
|
186
|
+
MAROON = RGB.new(0.501960784313725, 0.0, 0.0)
|
187
|
+
# Mauve: #E0B0FF
|
188
|
+
MAUVE = RGB.new(0.87843137254902, 0.690196078431373, 1.0)
|
189
|
+
# Medium carmine: #AF4035
|
190
|
+
MEDIUM_CARMINE = RGB.new(0.686274509803922, 0.250980392156863, 0.207843137254902)
|
191
|
+
# Medium Lavender: #EE82EE
|
192
|
+
MEDIUM_LAVENDER = RGB.new(0.933333333333333, 0.509803921568627, 0.933333333333333)
|
193
|
+
# Medium Purple: #9370DB
|
194
|
+
MEDIUM_PURPLE = RGB.new(0.576470588235294, 0.43921568627451, 0.858823529411765)
|
195
|
+
# Midnight Blue: #003366
|
196
|
+
MIDNIGHT_BLUE = RGB.new(0.0, 0.2, 0.4)
|
197
|
+
# Mint Green: #98FF98
|
198
|
+
MINT_GREEN = RGB.new(0.596078431372549, 1.0, 0.596078431372549)
|
199
|
+
# Moss green: #ADDFAD
|
200
|
+
MOSS_GREEN = RGB.new(0.67843137254902, 0.874509803921569, 0.67843137254902)
|
201
|
+
# Mountbatten pink: #997A8D
|
202
|
+
MOUNTBATTEN_PINK = RGB.new(0.6, 0.47843137254902, 0.552941176470588)
|
203
|
+
# Mustard: #FFDB58
|
204
|
+
MUSTARD = RGB.new(1.0, 0.858823529411765, 0.345098039215686)
|
205
|
+
# Navajo white: #FFDEAD
|
206
|
+
NAVAJO_WHITE = RGB.new(1.0, 0.870588235294118, 0.67843137254902)
|
207
|
+
# Navy Blue: #000080
|
208
|
+
NAVY_BLUE = RGB.new(0.0, 0.0, 0.501960784313725)
|
209
|
+
# Ochre: #CC7722
|
210
|
+
OCHRE = RGB.new(0.8, 0.466666666666667, 0.133333333333333)
|
211
|
+
# Old Gold: #CFB53B
|
212
|
+
OLD_GOLD = RGB.new(0.811764705882353, 0.709803921568627, 0.231372549019608)
|
213
|
+
# Old Lace: #FDF5E6
|
214
|
+
OLD_LACE = RGB.new(0.992156862745098, 0.96078431372549, 0.901960784313726)
|
215
|
+
# Old Lavender: #796878
|
216
|
+
OLD_LAVENDER = RGB.new(0.474509803921569, 0.407843137254902, 0.470588235294118)
|
217
|
+
# Old Rose: #C08081
|
218
|
+
OLD_ROSE = RGB.new(0.752941176470588, 0.501960784313725, 0.505882352941176)
|
219
|
+
# Olive: #808000
|
220
|
+
OLIVE = RGB.new(0.501960784313725, 0.501960784313725, 0.0)
|
221
|
+
# Olive Drab: #6B8E23
|
222
|
+
OLIVE_DRAB = RGB.new(0.419607843137255, 0.556862745098039, 0.137254901960784)
|
223
|
+
# Orange (color wheel): #FF7500
|
224
|
+
ORANGE_COLOR_WHEEL = RGB.new(1.0, 0.498039215686275, 0.0)
|
225
|
+
ORANGE = ORANGE_COLOR_WHEEL
|
226
|
+
# Orange (web): #FFA500
|
227
|
+
ORANGE_WEB = RGB.new(1.0, 0.647058823529412, 0.0)
|
228
|
+
# Orange Peel: #FFA000
|
229
|
+
ORANGE_PEEL = RGB.new(1.0, 0.627450980392157, 0.0)
|
230
|
+
# Orchid: #DA70D6
|
231
|
+
ORCHID = RGB.new(0.854901960784314, 0.43921568627451, 0.83921568627451)
|
232
|
+
# Papaya whip: #FFEFD5
|
233
|
+
PAPAYA_WHIP = RGB.new(1.0, 0.937254901960784, 0.835294117647059)
|
234
|
+
# Pastel green: #77DD77
|
235
|
+
PASTEL_GREEN = RGB.new(0.466666666666667, 0.866666666666667, 0.466666666666667)
|
236
|
+
# Pastel pink: #FFD1DC
|
237
|
+
PASTEL_PINK = RGB.new(1.0, 0.819607843137255, 0.862745098039216)
|
238
|
+
# Peach: #FFE5B4
|
239
|
+
PEACH = RGB.new(1.0, 0.898039215686275, 0.705882352941177)
|
240
|
+
# Peach-orange: #FFCC99
|
241
|
+
PEACH_ORANGE = RGB.new(1.0, 0.8, 0.6)
|
242
|
+
# Peach-yellow: #FADFAD
|
243
|
+
PEACH_YELLOW = RGB.new(0.980392156862745, 0.874509803921569, 0.67843137254902)
|
244
|
+
# Pear: #D1E231
|
245
|
+
PEAR = RGB.new(0.819607843137255, 0.886274509803922, 0.192156862745098)
|
246
|
+
# Periwinkle: #CCCCFF
|
247
|
+
PERIWINKLE = RGB.new(0.8, 0.8, 1.0)
|
248
|
+
# Persian blue: #1C39BB
|
249
|
+
PERSIAN_BLUE = RGB.new(0.109803921568627, 0.223529411764706, 0.733333333333333)
|
250
|
+
# Persian green: #00A693
|
251
|
+
PERSIAN_GREEN = RGB.new(0.0, 0.650980392156863, 0.576470588235294)
|
252
|
+
# Persian indigo: #32127A
|
253
|
+
PERSIAN_INDIGO = RGB.new(0.196078431372549, 0.0705882352941176, 0.47843137254902)
|
254
|
+
# Persian pink: #F77FBE
|
255
|
+
PERSIAN_PINK = RGB.new(0.968627450980392, 0.498039215686275, 0.745098039215686)
|
256
|
+
# Persian red: #CC3333
|
257
|
+
PERSIAN_RED = RGB.new(0.8, 0.2, 0.2)
|
258
|
+
# Persian rose: #FF1CB1
|
259
|
+
PERSIAN_ROSE = RGB.new(1.0, 0.109803921568627, 0.694117647058824)
|
260
|
+
# Pine Green: #01796F
|
261
|
+
PINE_GREEN = RGB.new(0.00392156862745098, 0.474509803921569, 0.435294117647059)
|
262
|
+
# Pink: #FFC0CB
|
263
|
+
PINK = RGB.new(1.0, 0.752941176470588, 0.796078431372549)
|
264
|
+
# Pink-orange: #FF9966
|
265
|
+
PINK_ORANGE = RGB.new(1.0, 0.6, 0.4)
|
266
|
+
# Pomegranate: #F34723
|
267
|
+
POMEGRANATE = RGB.new(0.952941176470588, 0.27843137254902, 0.137254901960784)
|
268
|
+
# Powder blue (web): #B0E0E6
|
269
|
+
POWDER_BLUE_WEB = RGB.new(0.690196078431373, 0.87843137254902, 0.901960784313726)
|
270
|
+
# Puce: #CC8899
|
271
|
+
PUCE = RGB.new(0.8, 0.533333333333333, 0.6)
|
272
|
+
# Prussian blue: #003153
|
273
|
+
PRUSSIAN_BLUE = RGB.new(0.0, 0.192156862745098, 0.325490196078431)
|
274
|
+
# Pumpkin: #FF7518
|
275
|
+
PUMPKIN = RGB.new(1.0, 0.458823529411765, 0.0941176470588235)
|
276
|
+
# Purple: #660099
|
277
|
+
PURPLE = RGB.new(0.4, 0.0, 0.6)
|
278
|
+
# Raw umber: #734A12
|
279
|
+
RAW_UMBER = RGB.new(0.450980392156863, 0.290196078431373, 0.0705882352941176)
|
280
|
+
# Red: #FF0000
|
281
|
+
RED = RGB.new(1.0, 0.0, 0.0)
|
282
|
+
# Red-violet: #C71585
|
283
|
+
RED_VIOLET = RGB.new(0.780392156862745, 0.0823529411764706, 0.52156862745098)
|
284
|
+
# Robin egg blue: #00CCCC
|
285
|
+
ROBIN_EGG_BLUE = RGB.new(0.0, 0.8, 0.8)
|
286
|
+
# Rose: #FF007F
|
287
|
+
ROSE = RGB.new(1.0, 0.0, 0.498039215686275)
|
288
|
+
# Royal Blue: #4169E1
|
289
|
+
ROYAL_BLUE = RGB.new(0.254901960784314, 0.411764705882353, 0.882352941176471)
|
290
|
+
# Russet: #80461B
|
291
|
+
RUSSET = RGB.new(0.501960784313725, 0.274509803921569, 0.105882352941176)
|
292
|
+
# Rust: #B7410E
|
293
|
+
RUST = RGB.new(0.717647058823529, 0.254901960784314, 0.0549019607843137)
|
294
|
+
# Safety Orange (Blaze Orange): #FF6600
|
295
|
+
SAFETY_ORANGE = RGB.new(1.0, 0.4, 0.0)
|
296
|
+
BLAZE_ORANGE = SAFETY_ORANGE
|
297
|
+
# Saffron: #F4C430
|
298
|
+
SAFFRON = RGB.new(0.956862745098039, 0.768627450980392, 0.188235294117647)
|
299
|
+
# Sapphire: #082567
|
300
|
+
SAPPHIRE = RGB.new(0.0313725490196078, 0.145098039215686, 0.403921568627451)
|
301
|
+
# Salmon: #FF8C69
|
302
|
+
SALMON = RGB.new(1.0, 0.549019607843137, 0.411764705882353)
|
303
|
+
# Sandy brown: #F4A460
|
304
|
+
SANDY_BROWN = RGB.new(0.956862745098039, 0.643137254901961, 0.376470588235294)
|
305
|
+
# Sangria: #92000A
|
306
|
+
SANGRIA = RGB.new(0.572549019607843, 0.0, 0.0392156862745098)
|
307
|
+
# Scarlet: #FF2400
|
308
|
+
SCARLET = RGB.new(1.0, 0.141176470588235, 0.0)
|
309
|
+
# School bus yellow: #FFD800
|
310
|
+
SCHOOL_BUS_YELLOW = RGB.new(1.0, 0.847058823529412, 0.0)
|
311
|
+
# Sea Green: #2E8B57
|
312
|
+
SEA_GREEN = RGB.new(0.180392156862745, 0.545098039215686, 0.341176470588235)
|
313
|
+
# Seashell: #FFF5EE
|
314
|
+
SEASHELL = RGB.new(1.0, 0.96078431372549, 0.933333333333333)
|
315
|
+
# Selective yellow: #FFBA00
|
316
|
+
SELECTIVE_YELLOW = RGB.new(1.0, 0.729411764705882, 0.0)
|
317
|
+
# Sepia: #704214
|
318
|
+
SEPIA = RGB.new(0.43921568627451, 0.258823529411765, 0.0784313725490196)
|
319
|
+
# Shocking Pink: #FC0FC0
|
320
|
+
SHOCKING_PINK = RGB.new(0.988235294117647, 0.0588235294117647, 0.752941176470588)
|
321
|
+
# Silver: #C0C0C0
|
322
|
+
SILVER = RGB.new(0.752941176470588, 0.752941176470588, 0.752941176470588)
|
323
|
+
# Slate gray: #708090
|
324
|
+
SLATE_GRAY = RGB.new(0.43921568627451, 0.501960784313725, 0.564705882352941)
|
325
|
+
# Smalt (Dark powder blue): #003399
|
326
|
+
SMALT = RGB.new(0.0, 0.2, 0.6)
|
327
|
+
DARK_POWDER_BLUE = SMALT
|
328
|
+
# Spring Green: #00FF7F
|
329
|
+
SPRING_GREEN = RGB.new(0.0, 1.0, 0.498039215686275)
|
330
|
+
# Steel blue: #4682B4
|
331
|
+
STEEL_BLUE = RGB.new(0.274509803921569, 0.509803921568627, 0.705882352941177)
|
332
|
+
# Swamp green: #ACB78E
|
333
|
+
SWAMP_GREEN = RGB.new(0.674509803921569, 0.717647058823529, 0.556862745098039)
|
334
|
+
# Tan: #D2B48C
|
335
|
+
TAN = RGB.new(0.823529411764706, 0.705882352941177, 0.549019607843137)
|
336
|
+
# Tangerine: #FFCC00
|
337
|
+
TANGERINE = RGB.new(1.0, 0.8, 0.0)
|
338
|
+
# Taupe: #483C32
|
339
|
+
TAUPE = RGB.new(0.282352941176471, 0.235294117647059, 0.196078431372549)
|
340
|
+
# Tea Green: #D0F0C0
|
341
|
+
TEA_GREEN = RGB.new(0.815686274509804, 0.941176470588235, 0.752941176470588)
|
342
|
+
# Teal: #008080
|
343
|
+
TEAL = RGB.new(0.0, 0.501960784313725, 0.501960784313725)
|
344
|
+
# Tenné (Tawny): #CD5700
|
345
|
+
TENNE = RGB.new(0.803921568627451, 0.341176470588235, 0.0)
|
346
|
+
TAWNY = TENNE
|
347
|
+
# Terra cotta: #E2725B
|
348
|
+
TERRA_COTTA = RGB.new(0.886274509803922, 0.447058823529412, 0.356862745098039)
|
349
|
+
# Thistle: #D8BFD8
|
350
|
+
THISTLE = RGB.new(0.847058823529412, 0.749019607843137, 0.847058823529412)
|
351
|
+
# Turquoise: #30D5C8
|
352
|
+
TURQUOISE = RGB.new(0.188235294117647, 0.835294117647059, 0.784313725490196)
|
353
|
+
# Ultramarine: #120A8F
|
354
|
+
ULTRAMARINE = RGB.new(0.0705882352941176, 0.0392156862745098, 0.56078431372549)
|
355
|
+
# Vermilion: #FF4D00
|
356
|
+
VERMILION = RGB.new(1.0, 0.301960784313725, 0.0)
|
357
|
+
# Violet: #8B00FF
|
358
|
+
VIOLET = RGB.new(0.545098039215686, 0.0, 1.0)
|
359
|
+
# Violet-eggplant: #991199
|
360
|
+
VIOLET_EGGPLANT = RGB.new(0.6, 0.0666666666666667, 0.6)
|
361
|
+
# Viridian: #40826D
|
362
|
+
VIRIDIAN = RGB.new(0.250980392156863, 0.509803921568627, 0.427450980392157)
|
363
|
+
# Wheat: #F5DEB3
|
364
|
+
WHEAT = RGB.new(0.96078431372549, 0.870588235294118, 0.701960784313725)
|
365
|
+
# White: #FFFFFF
|
366
|
+
WHITE = RGB.new(1.0, 1.0, 1.0)
|
367
|
+
# Wisteria: #C9A0DC
|
368
|
+
WISTERIA = RGB.new(0.788235294117647, 0.627450980392157, 0.862745098039216)
|
369
|
+
# Yellow: #FFFF00
|
370
|
+
YELLOW = RGB.new(1.0, 1.0, 0.0)
|
371
|
+
# Zinnwaldite: #EBC2AF
|
372
|
+
ZINNWALDITE = RGB.new(0.92156862745098, 0.76078431372549, 0.686274509803922)
|
373
|
+
module X11
|
374
|
+
# Gray: #BEBEBE
|
375
|
+
GRAY = RGB.new(0.745098039215686, 0.745098039215686, 0.745098039215686)
|
376
|
+
# Green: #00FF00
|
377
|
+
GREEN = RGB.new(0.0, 1.0, 0.0)
|
378
|
+
# Maroon: #B03060
|
379
|
+
MAROON = RGB.new(0.690196078431373, 0.188235294117647, 0.376470588235294)
|
380
|
+
# Purple: #A020F0
|
381
|
+
PURPLE = RGB.new(0.627450980392157, 0.125490196078431, 0.941176470588235)
|
382
|
+
# Alice Blue: #F0F8FF
|
383
|
+
ALICE_BLUE = RGB.new(0.941176470588235, 0.972549019607843, 1.0)
|
384
|
+
# Antique White: #FAEBD7
|
385
|
+
ANTIQUE_WHITE = RGB.new(0.980392156862745, 0.92156862745098, 0.843137254901961)
|
386
|
+
# Aqua: #00FFFF
|
387
|
+
AQUA = RGB.new(0.0, 1.0, 1.0)
|
388
|
+
# Aquamarine: #7FFFD4
|
389
|
+
AQUAMARINE = RGB.new(0.498039215686275, 1.0, 0.831372549019608)
|
390
|
+
# Azure: #F0FFFF
|
391
|
+
AZURE = RGB.new(0.941176470588235, 1.0, 1.0)
|
392
|
+
# Beige: #F5F5DC
|
393
|
+
BEIGE = RGB.new(0.96078431372549, 0.96078431372549, 0.862745098039216)
|
394
|
+
# Bisque: #FFE4C4
|
395
|
+
BISQUE = RGB.new(1.0, 0.894117647058824, 0.768627450980392)
|
396
|
+
# Black: #000000
|
397
|
+
BLACK = RGB.new(0.0, 0.0, 0.0)
|
398
|
+
# Blanched Almond: #FFEBCD
|
399
|
+
BLANCHED_ALMOND = RGB.new(1.0, 0.92156862745098, 0.803921568627451)
|
400
|
+
# Blue: #0000FF
|
401
|
+
BLUE = RGB.new(0.0, 0.0, 1.0)
|
402
|
+
# Blue Violet: #8A2BE2
|
403
|
+
BLUE_VIOLET = RGB.new(0.541176470588235, 0.168627450980392, 0.886274509803922)
|
404
|
+
# Brown: #A52A2A
|
405
|
+
BROWN = RGB.new(0.647058823529412, 0.164705882352941, 0.164705882352941)
|
406
|
+
# Burly Wood: #DEB887
|
407
|
+
BURLY_WOOD = RGB.new(0.870588235294118, 0.72156862745098, 0.529411764705882)
|
408
|
+
# Cadet Blue: #5F9EA0
|
409
|
+
CADET_BLUE = RGB.new(0.372549019607843, 0.619607843137255, 0.627450980392157)
|
410
|
+
# Chartreuse: #7FFF00
|
411
|
+
CHARTREUSE = RGB.new(0.498039215686275, 1.0, 0.0)
|
412
|
+
# Chocolate: #D2691E
|
413
|
+
CHOCOLATE = RGB.new(0.823529411764706, 0.411764705882353, 0.117647058823529)
|
414
|
+
# Coral: #FF7F50
|
415
|
+
CORAL = RGB.new(1.0, 0.498039215686275, 0.313725490196078)
|
416
|
+
# Cornflower Blue: #6495ED
|
417
|
+
CORNFLOWER_BLUE = RGB.new(0.392156862745098, 0.584313725490196, 0.929411764705882)
|
418
|
+
# Cornsilk: #FFF8DC
|
419
|
+
CORNSILK = RGB.new(1.0, 0.972549019607843, 0.862745098039216)
|
420
|
+
# Crimson: #DC143C
|
421
|
+
CRIMSON = RGB.new(0.862745098039216, 0.0784313725490196, 0.235294117647059)
|
422
|
+
# Cyan: #00FFFF
|
423
|
+
CYAN = RGB.new(0.0, 1.0, 1.0)
|
424
|
+
# Dark Blue: #00008B
|
425
|
+
DARK_BLUE = RGB.new(0.0, 0.0, 0.545098039215686)
|
426
|
+
# Dark Cyan: #008B8B
|
427
|
+
DARK_CYAN = RGB.new(0.0, 0.545098039215686, 0.545098039215686)
|
428
|
+
# Dark Goldenrod: #B8860B
|
429
|
+
DARK_GOLDENROD = RGB.new(0.72156862745098, 0.525490196078431, 0.0431372549019608)
|
430
|
+
# Dark Gray: #A9A9A9
|
431
|
+
DARK_GRAY = RGB.new(0.662745098039216, 0.662745098039216, 0.662745098039216)
|
432
|
+
# Dark Green: #006400
|
433
|
+
DARK_GREEN = RGB.new(0.0, 0.392156862745098, 0.0)
|
434
|
+
# Dark Khaki: #BDB76B
|
435
|
+
DARK_KHAKI = RGB.new(0.741176470588235, 0.717647058823529, 0.419607843137255)
|
436
|
+
# Dark Magenta: #8B008B
|
437
|
+
DARK_MAGENTA = RGB.new(0.545098039215686, 0.0, 0.545098039215686)
|
438
|
+
# Dark Olive Green: #556B2F
|
439
|
+
DARK_OLIVE_GREEN = RGB.new(0.333333333333333, 0.419607843137255, 0.184313725490196)
|
440
|
+
# Dark Orange: #FF8C00
|
441
|
+
DARK_ORANGE = RGB.new(1.0, 0.549019607843137, 0.0)
|
442
|
+
# Dark Orchid: #9932CC
|
443
|
+
DARK_ORCHID = RGB.new(0.6, 0.196078431372549, 0.8)
|
444
|
+
# Dark Red: #8B0000
|
445
|
+
DARK_RED = RGB.new(0.545098039215686, 0.0, 0.0)
|
446
|
+
# Dark Salmon: #E9967A
|
447
|
+
DARK_SALMON = RGB.new(0.913725490196078, 0.588235294117647, 0.47843137254902)
|
448
|
+
# Dark Sea Green: #8FBC8F
|
449
|
+
DARK_SEA_GREEN = RGB.new(0.56078431372549, 0.737254901960784, 0.56078431372549)
|
450
|
+
# Dark Slate Blue: #483D8B
|
451
|
+
DARK_SLATE_BLUE = RGB.new(0.282352941176471, 0.23921568627451, 0.545098039215686)
|
452
|
+
# Dark Slate Gray: #2F4F4F
|
453
|
+
DARK_SLATE_GRAY = RGB.new(0.184313725490196, 0.309803921568627, 0.309803921568627)
|
454
|
+
# Dark Turquoise: #00CED1
|
455
|
+
DARK_TURQUOISE = RGB.new(0.0, 0.807843137254902, 0.819607843137255)
|
456
|
+
# Dark Violet: #9400D3
|
457
|
+
DARK_VIOLET = RGB.new(0.580392156862745, 0.0, 0.827450980392157)
|
458
|
+
# Deep Pink: #FF1493
|
459
|
+
DEEP_PINK = RGB.new(1.0, 0.0784313725490196, 0.576470588235294)
|
460
|
+
# Deep Sky Blue: #00BFFF
|
461
|
+
DEEP_SKY_BLUE = RGB.new(0.0, 0.749019607843137, 1.0)
|
462
|
+
# Dim Gray: #696969
|
463
|
+
DIM_GRAY = RGB.new(0.411764705882353, 0.411764705882353, 0.411764705882353)
|
464
|
+
# Dodger Blue: #1E90FF
|
465
|
+
DODGER_BLUE = RGB.new(0.117647058823529, 0.564705882352941, 1.0)
|
466
|
+
# Fire Brick: #B22222
|
467
|
+
FIRE_BRICK = RGB.new(0.698039215686274, 0.133333333333333, 0.133333333333333)
|
468
|
+
# Floral White: #FFFAF0
|
469
|
+
FLORAL_WHITE = RGB.new(1.0, 0.980392156862745, 0.941176470588235)
|
470
|
+
# Forest Green: #228B22
|
471
|
+
FOREST_GREEN = RGB.new(0.133333333333333, 0.545098039215686, 0.133333333333333)
|
472
|
+
# Fuchsia: #FF00FF
|
473
|
+
FUCHSIA = RGB.new(1.0, 0.0, 1.0)
|
474
|
+
# Gainsboro: #DCDCDC
|
475
|
+
GAINSBORO = RGB.new(0.862745098039216, 0.862745098039216, 0.862745098039216)
|
476
|
+
# Ghost White: #F8F8FF
|
477
|
+
GHOST_WHITE = RGB.new(0.972549019607843, 0.972549019607843, 1.0)
|
478
|
+
# Gold: #FFD700
|
479
|
+
GOLD = RGB.new(1.0, 0.843137254901961, 0.0)
|
480
|
+
# Goldenrod: #DAA520
|
481
|
+
GOLDENROD = RGB.new(0.854901960784314, 0.647058823529412, 0.125490196078431)
|
482
|
+
# Green Yellow: #ADFF2F
|
483
|
+
GREEN_YELLOW = RGB.new(0.67843137254902, 1.0, 0.184313725490196)
|
484
|
+
# Honeydew: #F0FFF0
|
485
|
+
HONEYDEW = RGB.new(0.941176470588235, 1.0, 0.941176470588235)
|
486
|
+
# Hot Pink: #FF69B4
|
487
|
+
HOT_PINK = RGB.new(1.0, 0.411764705882353, 0.705882352941177)
|
488
|
+
# Indian Red: #CD5C5C
|
489
|
+
INDIAN_RED = RGB.new(0.803921568627451, 0.36078431372549, 0.36078431372549)
|
490
|
+
# Indigo: #4B0082
|
491
|
+
INDIGO = RGB.new(0.294117647058824, 0.0, 0.509803921568627)
|
492
|
+
# Ivory: #FFFFF0
|
493
|
+
IVORY = RGB.new(1.0, 1.0, 0.941176470588235)
|
494
|
+
# Khaki: #F0E68C
|
495
|
+
KHAKI = RGB.new(0.941176470588235, 0.901960784313726, 0.549019607843137)
|
496
|
+
# Lavender: #E6E6FA
|
497
|
+
LAVENDER = RGB.new(0.901960784313726, 0.901960784313726, 0.980392156862745)
|
498
|
+
# Lavender Blush: #FFF0F5
|
499
|
+
LAVENDER_BLUSH = RGB.new(1.0, 0.941176470588235, 0.96078431372549)
|
500
|
+
# Lawn Green: #7CFC00
|
501
|
+
LAWN_GREEN = RGB.new(0.486274509803922, 0.988235294117647, 0.0)
|
502
|
+
# Lemon Chiffon: #FFFACD
|
503
|
+
LEMON_CHIFFON = RGB.new(1.0, 0.980392156862745, 0.803921568627451)
|
504
|
+
# Light Blue: #ADD8E6
|
505
|
+
LIGHT_BLUE = RGB.new(0.67843137254902, 0.847058823529412, 0.901960784313726)
|
506
|
+
# Light Coral: #F08080
|
507
|
+
LIGHT_CORAL = RGB.new(0.941176470588235, 0.501960784313725, 0.501960784313725)
|
508
|
+
# Light Cyan: #E0FFFF
|
509
|
+
LIGHT_CYAN = RGB.new(0.87843137254902, 1.0, 1.0)
|
510
|
+
# Light Goldenrod Yellow: #FAFAD2
|
511
|
+
LIGHT_GOLDENROD_YELLOW = RGB.new(0.980392156862745, 0.980392156862745, 0.823529411764706)
|
512
|
+
# Light Green: #90EE90
|
513
|
+
LIGHT_GREEN = RGB.new(0.564705882352941, 0.933333333333333, 0.564705882352941)
|
514
|
+
# Light Grey: #D3D3D3
|
515
|
+
LIGHT_GREY = RGB.new(0.827450980392157, 0.827450980392157, 0.827450980392157)
|
516
|
+
# Light Pink: #FFB6C1
|
517
|
+
LIGHT_PINK = RGB.new(1.0, 0.713725490196078, 0.756862745098039)
|
518
|
+
# Light Salmon: #FFA07A
|
519
|
+
LIGHT_SALMON = RGB.new(1.0, 0.627450980392157, 0.47843137254902)
|
520
|
+
# Light Sea Green: #20B2AA
|
521
|
+
LIGHT_SEA_GREEN = RGB.new(0.125490196078431, 0.698039215686274, 0.666666666666667)
|
522
|
+
# Light Sky Blue: #87CEFA
|
523
|
+
LIGHT_SKY_BLUE = RGB.new(0.529411764705882, 0.807843137254902, 0.980392156862745)
|
524
|
+
# Light Slate Gray: #778899
|
525
|
+
LIGHT_SLATE_GRAY = RGB.new(0.466666666666667, 0.533333333333333, 0.6)
|
526
|
+
# Light Steel Blue: #B0C4DE
|
527
|
+
LIGHT_STEEL_BLUE = RGB.new(0.690196078431373, 0.768627450980392, 0.870588235294118)
|
528
|
+
# Light Yellow: #FFFFE0
|
529
|
+
LIGHT_YELLOW = RGB.new(1.0, 1.0, 0.87843137254902)
|
530
|
+
# Lime: #00FF00
|
531
|
+
LIME = RGB.new(0.0, 1.0, 0.0)
|
532
|
+
# Lime Green: #32CD32
|
533
|
+
LIME_GREEN = RGB.new(0.196078431372549, 0.803921568627451, 0.196078431372549)
|
534
|
+
# Linen: #FAF0E6
|
535
|
+
LINEN = RGB.new(0.980392156862745, 0.941176470588235, 0.901960784313726)
|
536
|
+
# Magenta: #FF00FF
|
537
|
+
MAGENTA = RGB.new(1.0, 0.0, 1.0)
|
538
|
+
# Medium Aquamarine: #66CDAA
|
539
|
+
MEDIUM_AQUAMARINE = RGB.new(0.4, 0.803921568627451, 0.666666666666667)
|
540
|
+
# Medium Blue: #0000CD
|
541
|
+
MEDIUM_BLUE = RGB.new(0.0, 0.0, 0.803921568627451)
|
542
|
+
# Medium Orchid: #BA55D3
|
543
|
+
MEDIUM_ORCHID = RGB.new(0.729411764705882, 0.333333333333333, 0.827450980392157)
|
544
|
+
# Medium Purple: #9370DB
|
545
|
+
MEDIUM_PURPLE = RGB.new(0.576470588235294, 0.43921568627451, 0.858823529411765)
|
546
|
+
# Medium Sea Green: #3CB371
|
547
|
+
MEDIUM_SEA_GREEN = RGB.new(0.235294117647059, 0.701960784313725, 0.443137254901961)
|
548
|
+
# Medium Slate Blue: #7B68EE
|
549
|
+
MEDIUM_SLATE_BLUE = RGB.new(0.482352941176471, 0.407843137254902, 0.933333333333333)
|
550
|
+
# Medium Spring Green: #00FA9A
|
551
|
+
MEDIUM_SPRING_GREEN = RGB.new(0.0, 0.980392156862745, 0.603921568627451)
|
552
|
+
# Medium Turquoise: #48D1CC
|
553
|
+
MEDIUM_TURQUOISE = RGB.new(0.282352941176471, 0.819607843137255, 0.8)
|
554
|
+
# Medium Violet Red: #C71585
|
555
|
+
MEDIUM_VIOLET_RED = RGB.new(0.780392156862745, 0.0823529411764706, 0.52156862745098)
|
556
|
+
# Midnight Blue: #191970
|
557
|
+
MIDNIGHT_BLUE = RGB.new(0.0980392156862745, 0.0980392156862745, 0.43921568627451)
|
558
|
+
# Mint Cream: #F5FFFA
|
559
|
+
MINT_CREAM = RGB.new(0.96078431372549, 1.0, 0.980392156862745)
|
560
|
+
# Misty Rose: #FFE4E1
|
561
|
+
MISTY_ROSE = RGB.new(1.0, 0.894117647058824, 0.882352941176471)
|
562
|
+
# Moccasin: #FFE4B5
|
563
|
+
MOCCASIN = RGB.new(1.0, 0.894117647058824, 0.709803921568627)
|
564
|
+
# Navajo White: #FFDEAD
|
565
|
+
NAVAJO_WHITE = RGB.new(1.0, 0.870588235294118, 0.67843137254902)
|
566
|
+
# Old Lace: #FDF5E6
|
567
|
+
OLD_LACE = RGB.new(0.992156862745098, 0.96078431372549, 0.901960784313726)
|
568
|
+
# Olive: #808000
|
569
|
+
OLIVE = RGB.new(0.501960784313725, 0.501960784313725, 0.0)
|
570
|
+
# Olive Drab: #6B8E23
|
571
|
+
OLIVE_DRAB = RGB.new(0.419607843137255, 0.556862745098039, 0.137254901960784)
|
572
|
+
# Orange: #FFA500
|
573
|
+
ORANGE = RGB.new(1.0, 0.647058823529412, 0.0)
|
574
|
+
# Orange Red: #FF4500
|
575
|
+
ORANGE_RED = RGB.new(1.0, 0.270588235294118, 0.0)
|
576
|
+
# Orchid: #DA70D6
|
577
|
+
ORCHID = RGB.new(0.854901960784314, 0.43921568627451, 0.83921568627451)
|
578
|
+
# Pale Goldenrod: #EEE8AA
|
579
|
+
PALE_GOLDENROD = RGB.new(0.933333333333333, 0.909803921568627, 0.666666666666667)
|
580
|
+
# Pale Green: #98FB98
|
581
|
+
PALE_GREEN = RGB.new(0.596078431372549, 0.984313725490196, 0.596078431372549)
|
582
|
+
# Pale Turquoise: #AFEEEE
|
583
|
+
PALE_TURQUOISE = RGB.new(0.686274509803922, 0.933333333333333, 0.933333333333333)
|
584
|
+
# Pale Violet Red: #DB7093
|
585
|
+
PALE_VIOLET_RED = RGB.new(0.858823529411765, 0.43921568627451, 0.576470588235294)
|
586
|
+
# Papaya Whip: #FFEFD5
|
587
|
+
PAPAYA_WHIP = RGB.new(1.0, 0.937254901960784, 0.835294117647059)
|
588
|
+
# Peach Puff: #FFDAB9
|
589
|
+
PEACH_PUFF = RGB.new(1.0, 0.854901960784314, 0.725490196078431)
|
590
|
+
# Peru: #CD853F
|
591
|
+
PERU = RGB.new(0.803921568627451, 0.52156862745098, 0.247058823529412)
|
592
|
+
# Pink: #FFC0CB
|
593
|
+
PINK = RGB.new(1.0, 0.752941176470588, 0.796078431372549)
|
594
|
+
# Plum: #DDA0DD
|
595
|
+
PLUM = RGB.new(0.866666666666667, 0.627450980392157, 0.866666666666667)
|
596
|
+
# Powder Blue: #B0E0E6
|
597
|
+
POWDER_BLUE = RGB.new(0.690196078431373, 0.87843137254902, 0.901960784313726)
|
598
|
+
# Red: #FF0000
|
599
|
+
RED = RGB.new(1.0, 0.0, 0.0)
|
600
|
+
# Rosy Brown: #BC8F8F
|
601
|
+
ROSY_BROWN = RGB.new(0.737254901960784, 0.56078431372549, 0.56078431372549)
|
602
|
+
# Royal Blue: #4169E1
|
603
|
+
ROYAL_BLUE = RGB.new(0.254901960784314, 0.411764705882353, 0.882352941176471)
|
604
|
+
# Saddle Brown: #8B4513
|
605
|
+
SADDLE_BROWN = RGB.new(0.545098039215686, 0.270588235294118, 0.0745098039215686)
|
606
|
+
# Salmon: #FA8072
|
607
|
+
SALMON = RGB.new(0.980392156862745, 0.501960784313725, 0.447058823529412)
|
608
|
+
# Sandy Brown: #F4A460
|
609
|
+
SANDY_BROWN = RGB.new(0.956862745098039, 0.643137254901961, 0.376470588235294)
|
610
|
+
# Sea Green: #2E8B57
|
611
|
+
SEA_GREEN = RGB.new(0.180392156862745, 0.545098039215686, 0.341176470588235)
|
612
|
+
# Seashell: #FFF5EE
|
613
|
+
SEASHELL = RGB.new(1.0, 0.96078431372549, 0.933333333333333)
|
614
|
+
# Sienna: #A0522D
|
615
|
+
SIENNA = RGB.new(0.627450980392157, 0.32156862745098, 0.176470588235294)
|
616
|
+
# Silver: #C0C0C0
|
617
|
+
SILVER = RGB.new(0.752941176470588, 0.752941176470588, 0.752941176470588)
|
618
|
+
# Sky Blue: #87CEEB
|
619
|
+
SKY_BLUE = RGB.new(0.529411764705882, 0.807843137254902, 0.92156862745098)
|
620
|
+
# Slate Blue: #6A5ACD
|
621
|
+
SLATE_BLUE = RGB.new(0.415686274509804, 0.352941176470588, 0.803921568627451)
|
622
|
+
# Slate Gray: #708090
|
623
|
+
SLATE_GRAY = RGB.new(0.43921568627451, 0.501960784313725, 0.564705882352941)
|
624
|
+
# Snow: #FFFAFA
|
625
|
+
SNOW = RGB.new(1.0, 0.980392156862745, 0.980392156862745)
|
626
|
+
# Spring Green: #00FF7F
|
627
|
+
SPRING_GREEN = RGB.new(0.0, 1.0, 0.498039215686275)
|
628
|
+
# Steel Blue: #4682B4
|
629
|
+
STEEL_BLUE = RGB.new(0.274509803921569, 0.509803921568627, 0.705882352941177)
|
630
|
+
# Tan: #D2B48C
|
631
|
+
TAN = RGB.new(0.823529411764706, 0.705882352941177, 0.549019607843137)
|
632
|
+
# Teal: #008080
|
633
|
+
TEAL = RGB.new(0.0, 0.501960784313725, 0.501960784313725)
|
634
|
+
# Thistle: #D8BFD8
|
635
|
+
THISTLE = RGB.new(0.847058823529412, 0.749019607843137, 0.847058823529412)
|
636
|
+
# Tomato: #FF6347
|
637
|
+
TOMATO = RGB.new(1.0, 0.388235294117647, 0.27843137254902)
|
638
|
+
# Turquoise: #40E0D0
|
639
|
+
TURQUOISE = RGB.new(0.250980392156863, 0.87843137254902, 0.815686274509804)
|
640
|
+
# Violet: #EE82EE
|
641
|
+
VIOLET = RGB.new(0.933333333333333, 0.509803921568627, 0.933333333333333)
|
642
|
+
# Wheat: #F5DEB3
|
643
|
+
WHEAT = RGB.new(0.96078431372549, 0.870588235294118, 0.701960784313725)
|
644
|
+
# White: #FFFFFF
|
645
|
+
WHITE = RGB.new(1.0, 1.0, 1.0)
|
646
|
+
# White Smoke: #F5F5F5
|
647
|
+
WHITE_SMOKE = RGB.new(0.96078431372549, 0.96078431372549, 0.96078431372549)
|
648
|
+
# Yellow: #FFFF00
|
649
|
+
YELLOW = RGB.new(1.0, 1.0, 0.0)
|
650
|
+
# Yellow Green: #9ACD32
|
651
|
+
YELLOW_GREEN = RGB.new(0.603921568627451, 0.803921568627451, 0.196078431372549)
|
652
|
+
end
|
653
|
+
include X11
|
654
|
+
|
655
|
+
end
|
656
|
+
end
|