pike.git
/
src
/
modules
/
Image
/
colors.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/Image/colors.c:1:
/* **! module Image **! note
-
**! $Id: colors.c,v 1.
52
2001/07/
17
03
:
44
:
13
nilsson Exp $
+
**! $Id: colors.c,v 1.
53
2001/07/
18
18
:
49
:
58
nilsson Exp $
**! submodule Color **! **! This module keeps names and easy handling **! for easy color support. It gives you an easy **! way to get colors from names. **! **! A color is here an object, containing color **! information and methods for conversion, see below. **! **! <ref>Image.Color</ref> can be called to make a color object.
pike.git/src/modules/Image/colors.c:172:
**! class Color **! This is the color object. It has six readable variables, **! <tt>r</tt>, <tt>g</tt>, <tt>b</tt>, for the <i>red</i>, **! <i>green</i> and <i>blue</i> values, **! and <tt>h</tt>, <tt>s</tt>, <tt>v</tt>, for **! the <i>hue</i>, <i>saturation</i> anv <i>value</i> values. */ #include "global.h"
-
RCSID("$Id: colors.c,v 1.
52
2001/07/
17
03
:
44
:
13
nilsson Exp $");
+
RCSID("$Id: colors.c,v 1.
53
2001/07/
18
18
:
49
:
58
nilsson Exp $");
#include "image_machine.h" #include <math.h> #include "stralloc.h" #include "pike_macros.h" #include "object.h" #include "constants.h" #include "interpret.h"
pike.git/src/modules/Image/colors.c:1003:
**! method object dark() **! method object neon() **! method object bright() **! method object dull() **! Color modification methods. These returns **! a new color. **! <table> **! <tr><th>method</th><th width=50%>effect</th> **! <th>h</th><th>s</th><th>v</th><th>as</th></tr> **! <tr><td>light </td><td>raise light level</td><td>±0</td><td> ±0</td><td>+50</td>
-
**! <td><illustration>return Image(20,20,@(array)Color["#693e3e"])</illustration>
-
**! <illustration>return Image(20,20,@(array)Color["#693e3e"]->light())</illustration>
-
**! <illustration>return Image(20,20,@(array)Color["#693e3e"]->light()->light())</illustration>
-
**! <illustration>return Image(20,20,@(array)Color["#693e3e"]->light()->light()->light())</illustration></td></tr>
+
**! <td><illustration>return Image
.Image
(20,20,@(array)
Image.
Color["#693e3e"])</illustration>
+
**! <illustration>return Image
.Image
(20,20,@(array)
Image.
Color["#693e3e"]->light())</illustration>
+
**! <illustration>return Image
.Image
(20,20,@(array)
Image.
Color["#693e3e"]->light()->light())</illustration>
+
**! <illustration>return Image
.Image
(20,20,@(array)
Image.
Color["#693e3e"]->light()->light()->light())</illustration></td></tr>
**! **! <tr><td>dark </td><td>lower light level</td><td>±0</td><td> ±0</td><td>-50</td>
-
**! <td><illustration>return Image(20,20,@(array)Color["#693e3e"])</illustration>
-
**! <illustration>return Image(20,20,@(array)Color["#693e3e"]->dark())</illustration>
-
**! <illustration>return Image(20,20,@(array)Color["#693e3e"]->dark()->dark())</illustration>
-
**! <illustration>return Image(20,20,@(array)Color["#693e3e"]->dark()->dark()->dark())</illustration></td></tr>
+
**! <td><illustration>return Image
.Image
(20,20,@(array)
Image.
Color["#693e3e"])</illustration>
+
**! <illustration>return Image
.Image
(20,20,@(array)
Image.
Color["#693e3e"]->dark())</illustration>
+
**! <illustration>return Image
.Image
(20,20,@(array)
Image.
Color["#693e3e"]->dark()->dark())</illustration>
+
**! <illustration>return Image
.Image
(20,20,@(array)
Image.
Color["#693e3e"]->dark()->dark()->dark())</illustration></td></tr>
**! **! <tr><td>bright</td><td>brighter color </td><td>±0</td><td>+50</td><td>+50</td>
-
**! <td><illustration>return Image(20,20,@(array)Color["#693e3e"])</illustration>
-
**! <illustration>return Image(20,20,@(array)Color["#693e3e"]->bright())</illustration>
-
**! <illustration>return Image(20,20,@(array)Color["#693e3e"]->bright()->bright())</illustration>
-
**! <illustration>return Image(20,20,@(array)Color["#693e3e"]->bright()->bright()->bright())</illustration></td></tr>
+
**! <td><illustration>return Image
.Image
(20,20,@(array)
Image.
Color["#693e3e"])</illustration>
+
**! <illustration>return Image
.Image
(20,20,@(array)
Image.
Color["#693e3e"]->bright())</illustration>
+
**! <illustration>return Image
.Image
(20,20,@(array)
Image.
Color["#693e3e"]->bright()->bright())</illustration>
+
**! <illustration>return Image
.Image
(20,20,@(array)
Image.
Color["#693e3e"]->bright()->bright()->bright())</illustration></td></tr>
**! **! <tr><td>dull </td><td>greyer color </td><td>±0</td><td>-50</td><td>-50</td>
-
**! <td><illustration>return Image(20,20,@(array)Color.red)</illustration>
-
**! <illustration>return Image(20,20,@(array)Color.red->dull())</illustration>
-
**! <illustration>return Image(20,20,@(array)Color.red->dull()->dull())</illustration>
-
**! <illustration>return Image(20,20,@(array)Color.red->dull()->dull()->dull())</illustration></td></tr>
+
**! <td><illustration>return Image
.Image
(20,20,@(array)
Image.
Color.red)</illustration>
+
**! <illustration>return Image
.Image
(20,20,@(array)
Image.
Color.red->dull())</illustration>
+
**! <illustration>return Image
.Image
(20,20,@(array)
Image.
Color.red->dull()->dull())</illustration>
+
**! <illustration>return Image
.Image
(20,20,@(array)
Image.
Color.red->dull()->dull()->dull())</illustration></td></tr>
**! **! <tr><td>neon </td><td>set to extreme </td><td>±0</td><td>max</td><td>max</td>
-
**! <td><illustration>return Image(20,20,@(array)Color["#693e3e"])</illustration>
-
**! <illustration>return Image(20,20,@(array)Color["#693e3e"]->neon())</illustration></td></tr>
+
**! <td><illustration>return Image
.Image
(20,20,@(array)
Image.
Color["#693e3e"])</illustration>
+
**! <illustration>return Image
.Image
(20,20,@(array)
Image.
Color["#693e3e"]->neon())</illustration></td></tr>
**! **! </table> **! **! <ref>light</ref> and <ref>dark</ref> lower/highers saturation **! when value is min-/maximised respective. **! **! returns the new color object **! note: **! The opposites may not always take each other out. **! The color is maximised at white and black levels,