pike.git / src / modules / Image / colors.c

version» Context lines:

pike.git/src/modules/Image/colors.c:1:   /*   **! module Image   **! note - **! $Id: colors.c,v 1.54 2001/07/19 21:09:37 nilsson Exp $ + **! $Id: colors.c,v 1.55 2001/07/30 13:19:35 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:81:   **! <tt>Image.Color</tt>() is case- and space-sensitive.   **! Use <ref>Image.Color.guess</ref>() to catch all variants.   **!   **! and subtract with a space (lower_case(x)-" ") to make   **! sure you get all variants.   **!   **! see also: Image.Color.Color, Image.Color.guess, Image, Image.Colortable   **!   **!   **! appendix Image.Color colors + **! + **! This table lists all the different named colors available in Image.Color. + **! The first column shows the actual color while the five following columns + **! demonstrates the modifiers neon, light, dark, bright and dull. The color + **! begind the name of the color is produced by calling neon()->dark()->dark()->dark() + **! from the color object itself, i.e. Image.Color.mintcream->neon()->dark()->dark()->dark(). + **!   **! <execute>   **!   **! import Image;   **!   **! array modifiers=({"neon","light","dark","bright","dull"});   **!   **! object F=Font();   **!   **! mixed color_info(array(object) ac)   **! {
pike.git/src/modules/Image/colors.c:143:   **! write(mktag("br"));   **! }   **!   **! void main()   **! {   **! array cs=values(Color);   **!   **! array orig=({Color.black,Color.red,Color.green,Color.yellow,   **! Color.blue,Color.violet,Color.cyan,Color.white});   **! cs-=orig; + **! cs-=({Color.pikegreen,Color.avantgardepikegreen,Color.roxenorange, + **! Color.pikeblue}); // Lame sort of easter egg.   **!   **! array grey=Array.filter(cs,lambda(object c) { return c->s==0; });   **! array colored=cs-grey;   **!   **! sort(grey->v,grey);   **! sort(Array.map(colored,lambda(object c)   **! {   **! return (c->h*50-c->s)*10+c->v;   **! }),colored);   **!   **! Array.map(({orig}),color_info); - **! write("\240"); + **! // write("\240");   **! Array.map(({grey}),color_info); - **! write("\240"); + **! // write("\240");   **! Array.map(colored/8.0,color_info);   **! }   **!   **! </execute>   **!   **! 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.54 2001/07/19 21:09:37 nilsson Exp $"); + RCSID("$Id: colors.c,v 1.55 2001/07/30 13:19:35 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"