]> gitweb.factorcode.org Git - factor.git/blob - basis/colors/constants/constants-docs.factor
14a22d9809f978489fc395e0c246efc673b6deeb
[factor.git] / basis / colors / constants / constants-docs.factor
1 IN: colors.constants
2 USING: help.markup help.syntax strings colors ;
3
4 HELP: lookup-color
5 { $values { "name" string } { "color" color } }
6 { $description "Outputs a named color from the color 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" } ", " { $snippet "factor-colors.txt" } " or " { $snippet "solarized-colors.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 Factor's " { $snippet "factor-colors.txt" } " theme database to provide words for looking up color values by name."
27 { $subsections
28     lookup-color
29     named-colors
30     POSTPONE: COLOR:
31 } ;
32
33 ABOUT: "colors.constants"