summaryrefslogtreecommitdiff
path: root/doc/graphics/color.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/graphics/color.texi')
-rw-r--r--doc/graphics/color.texi64
1 files changed, 64 insertions, 0 deletions
diff --git a/doc/graphics/color.texi b/doc/graphics/color.texi
new file mode 100644
index 0000000..99e69ba
--- /dev/null
+++ b/doc/graphics/color.texi
@@ -0,0 +1,64 @@
+@node Colors
+@section Colors
+
+Colors store RGBA data in OpenGL format. Each color channel has a
+value in the range [0, 1].
+
+@anchor{2d color make-color}@defspec make-color
+@end defspec
+
+@anchor{2d color color?}@defspec color?
+@end defspec
+
+@anchor{2d color color-r}@defspec color-r
+@end defspec
+
+@anchor{2d color color-g}@defspec color-g
+@end defspec
+
+@anchor{2d color color-b}@defspec color-b
+@end defspec
+
+@anchor{2d color color-a}@defspec color-a
+@end defspec
+
+@anchor{2d color use-color}@defun use-color color
+Set the current OpenGL color state to the contents of COLOR.
+
+@end defun
+
+A lot of people are used to working with colors as hexadecimal values,
+so the following procedures are provided to convert hexadecimal color
+codes into color objects.
+
+@anchor{2d color rgba}@defun rgba color-code
+Translate an RGBA format string COLOR-CODE into a color object. For
+example: #xffffffff will return a color with RGBA values 1, 1, 1, 1.
+
+@end defun
+
+@anchor{2d color rgb}@defun rgb color-code
+Translate an RGB format string COLOR-CODE into a color object. For
+example: #xffffff will return a color with RGBA values 1, 1, 1, 1.
+
+@end defun
+
+Commonly used colors are predefined for convenience.
+
+@anchor{2d color white}@defvar white
+@end defvar
+
+@anchor{2d color black}@defvar black
+@end defvar
+
+@anchor{2d color red}@defvar red
+@end defvar
+
+@anchor{2d color green}@defvar green
+@end defvar
+
+@anchor{2d color blue}@defvar blue
+@end defvar
+
+@anchor{2d color magenta}@defvar magenta
+@end defvar