diff --git a/basis/colors/colors-docs.factor b/basis/colors/colors-docs.factor index 13abefbf60..8881d89711 100644 --- a/basis/colors/colors-docs.factor +++ b/basis/colors/colors-docs.factor @@ -32,6 +32,7 @@ $nl { $subsection >rgba-components } "Further topics:" { $subsection "colors.protocol" } +{ $subsection "colors.constants" } { $vocab-subsection "Grayscale colors" "colors.gray" } { $vocab-subsection "HSV colors" "colors.hsv" } ; diff --git a/basis/colors/constants/constants-docs.factor b/basis/colors/constants/constants-docs.factor new file mode 100644 index 0000000000..633bd20ed2 --- /dev/null +++ b/basis/colors/constants/constants-docs.factor @@ -0,0 +1,31 @@ +IN: colors.constants +USING: help.markup help.syntax strings colors ; + +HELP: named-color +{ $values { "string" string } { "color" color } } +{ $description "Outputs a named color from the " { $snippet "rgb.txt" } " database." } +{ $notes "In most cases, " { $link POSTPONE: COLOR: } " should be used instead." } +{ $errors "Throws an error if the color is not listed in " { $snippet "rgb.txt" } "." } ; + +HELP: named-colors +{ $values { "keys" "a sequence of strings" } } +{ $description "Outputs a sequence of all colors in the " { $snippet "rgb.txt" } " database." } ; + +HELP: COLOR: +{ $syntax "COLOR: name" } +{ $description "Parses as a " { $link color } " object with the given name." } +{ $errors "Throws an error if the color is not listed in " { $snippet "rgb.txt" } "." } +{ $examples + { $code + "USING: colors.constants io.styles ;" + "\"Hello!\" { { foreground COLOR: cyan } } format nl" + } +} ; + +ARTICLE: "colors.constants" "Standard color database" +"The " { $vocab-link "colors.constants" } " vocabulary bundles the X11 " { $snippet "rgb.txt" } " database and provides words for looking up color values." +{ $subsection named-color } +{ $subsection named-colors } +{ $subsection POSTPONE: COLOR: } ; + +ABOUT: "colors.constants" \ No newline at end of file