2 USING: accessors help.markup help.syntax ;
5 { $class-description "The class of colors. Implementations include " { $link rgba } ", " { $vocab-link "colors.gray" } " and " { $vocab-link "colors.hsv" } "." } ;
8 { $class-description "The class of colors with red, green, blue and alpha channel components. The slots store color components, which are real numbers in the range 0 to 1, inclusive." } ;
11 { $values { "color" color } { "rgba" rgba } }
12 { $contract "Converts a color to an RGBA color." } ;
14 ARTICLE: "colors.protocol" "Color protocol"
15 "Abstract superclass for colors:"
17 "All color objects must are required to implement a method on the " { $link >rgba } " generic word."
19 "Optionally, they can provide methods on the accessors " { $link red>> } ", " { $link green>> } ", " { $link blue>> } " and " { $link alpha>> } ", either by defining slots with the appropriate names, or with methods which calculate the color component values. The accessors should return color components which are real numbers in the range between 0 and 1."
21 "Overriding the accessors is purely an optimization, since the default implementations call " { $link >rgba } " and then extract the appropriate component of the result." ;
23 ARTICLE: "colors" "Colors"
24 "The " { $vocab-link "colors" } " vocabulary defines a protocol for colors, with a concrete implementation for RGBA colors. This vocabulary is used by " { $vocab-link "io.styles" } ", " { $vocab-link "ui" } " and other vocabularies, but it is independent of them."
28 { $subsection <rgba> }
29 "Converting a color to RGBA:"
31 "Extracting RGBA components of colors:"
32 { $subsection >rgba-components }
34 { $subsection "colors.protocol" }
35 { $subsection "colors.constants" }
36 { $vocab-subsection "Grayscale colors" "colors.gray" }
37 { $vocab-subsection "HSV colors" "colors.hsv" } ;