]> gitweb.factorcode.org Git - factor.git/blob - basis/colors/constants/constants-docs.factor
Merge OneEyed's patch
[factor.git] / basis / colors / constants / constants-docs.factor
1 IN: colors.constants
2 USING: help.markup help.syntax strings colors ;
3
4 HELP: named-color
5 { $values { "string" string } { "color" color } }
6 { $description "Outputs a named color from the " { $snippet "rgb.txt" } " database." }
7 { $notes "In most cases, " { $link POSTPONE: COLOR: } " should be used instead." }
8 { $errors "Throws an error if the color is not listed in " { $snippet "rgb.txt" } "." } ;
9
10 HELP: named-colors
11 { $values { "keys" "a sequence of strings" } }
12 { $description "Outputs a sequence of all colors in the " { $snippet "rgb.txt" } " database." } ;
13
14 HELP: COLOR:
15 { $syntax "COLOR: name" }
16 { $description "Parses as a " { $link color } " object with the given name." }
17 { $errors "Throws an error if the color is not listed in " { $snippet "rgb.txt" } "." }
18 { $examples
19   { $code
20     "USING: colors.constants io.styles ;"
21     "\"Hello!\" { { foreground COLOR: cyan } } format nl"
22   }
23 } ;
24
25 ARTICLE: "colors.constants" "Standard color database"
26 "The " { $vocab-link "colors.constants" } " vocabulary bundles the X11 " { $snippet "rgb.txt" } " database and provides words for looking up color values."
27 { $subsection named-color }
28 { $subsection named-colors }
29 { $subsection POSTPONE: COLOR: } ;
30
31 ABOUT: "colors.constants"