From 36a84edf7ea37d20e003a36019bb12d0d1576e42 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 15 Sep 2013 22:25:35 -0400 Subject: Clean up docstrings in color module. --- 2d/color.scm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to '2d') 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) -- cgit v1.2.3