]> gitweb.factorcode.org Git - factor.git/commitdiff
Document colors.constants
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 20 Feb 2009 00:20:57 +0000 (18:20 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 20 Feb 2009 00:20:57 +0000 (18:20 -0600)
basis/colors/colors-docs.factor
basis/colors/constants/constants-docs.factor [new file with mode: 0644]

index 13abefbf6021771cf0f180aa49339042687653be..8881d8971144a6ef8aec3b662b7851c05e28fa35 100644 (file)
@@ -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 (file)
index 0000000..633bd20
--- /dev/null
@@ -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