summaryrefslogtreecommitdiff
path: root/2d
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@member.fsf.org>2013-09-15 22:25:35 -0400
committerDavid Thompson <dthompson@member.fsf.org>2013-09-15 22:25:35 -0400
commit36a84edf7ea37d20e003a36019bb12d0d1576e42 (patch)
tree7ce6e0b874977102469c31a105dedda0e1c486b3 /2d
parent37f162b6cefc6669b9b865da0e1055419f7b7633 (diff)
Clean up docstrings in color module.
Diffstat (limited to '2d')
-rw-r--r--2d/color.scm15
1 files changed, 9 insertions, 6 deletions
diff --git a/2d/color.scm b/2d/color.scm
index e23d493..de9a968 100644
--- a/2d/color.scm
+++ b/2d/color.scm
@@ -51,30 +51,33 @@
(a color-a))
(define (use-color color)
- "Sets the current OpenGL color."
+ "Set the current OpenGL color state to the contents of COLOR."
(gl-color (color-r color)
(color-g color)
(color-b color)
(color-a color)))
(define (color-component color-code offset)
- "Returns the value of a color channel in the range [0,1]."
+ "Return the value of an 8-bit color channel in the range [0,1] for
+the integer COLOR-CODE, given an OFFSET in bits."
(let ((mask (ash #xff offset)))
(/ (ash (logand mask color-code)
(- offset))
255.0)))
(define (rgba color-code)
- "Translates an RGBA format color code into a color object. For
-example: #xffffffff will return a color with RGBA values 1, 1, 1, 1."
+ "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."
(make-color (color-component color-code 24)
(color-component color-code 16)
(color-component color-code 8)
(color-component color-code 0)))
(define (rgb color-code)
- "Translates an RGB format color code into a color object. For
-example: #xffffff will return a color with RGBA values 1, 1, 1, 1."
+ "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."
(make-color (color-component color-code 16)
(color-component color-code 8)
(color-component color-code 0)