source: project/wiki/eggref/4/x11-colors @ 15320

Last change on this file since 15320 was 15320, checked in by felix winkelmann, 11 years ago

added x11-colors page

File size: 2.2 KB
Line 
1[[toc:]]
2[[tags: egg]]
3
4== Introduction
5
6This extension maps named colors (as found in the X11 rgb.txt file) to RGB values.
7A single procedure is exported:
8
9  [procedure] (color COLOR)
10
11Returns a vector containing the red, green and blue values for the
12given named color value. {{COLOR}} may be a 3-element list, a
133-element vector, a string or a symbol.  RGB values are in the range 0
14to 255. If a name is given as argument and no color can be found,
15{{COLOR}} returns {{#f}}. Color name comparisons are case-insensitive.
16
17== Requirements
18
19  [[eggref/r/matchable]]
20
21== Usage
22
23  (require-extension x11-colors)
24
25== Examples
26
27  (color "Peach Puff")  ==>  #(255 218 185)
28
29== Author
30
31[[felix winkelmann]]
32
33== Version history
34
35; 1.0 : initial version
36
37== License
38
39 Copyright (c) 2009, Felix L. Winkelmann
40 All rights reserved.
41
42 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
43 conditions are met:
44
45   Redistributions of source code must retain the above copyright notice, this list of conditions and the following
46     disclaimer.
47   Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
48     disclaimer in the documentation and/or other materials provided with the distribution.
49   Neither the name of the author nor the names of its contributors may be used to endorse or promote
50     products derived from this software without specific prior written permission.
51
52 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
53 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
54 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
55 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
56 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
57 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
58 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
59 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
60 POSSIBILITY OF SUCH DAMAGE.
Note: See TracBrowser for help on using the repository browser.