1 /******************************************************************************
2 *
3 * Copyright (C) 2005, The Gentee Group. All rights reserved.
4 * This file is part of the Gentee open source project - http://www.gentee.com.
5 *
6 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE GENTEE LICENSE ("AGREEMENT").
7 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE CONSTITUTES RECIPIENTS
8 * ACCEPTANCE OF THE AGREEMENT.
9 *
10 * ID: webcolors 17.10.06 0.0.A.
11 *
12 * Author: Alexey Krivonogov ( gentee )
13 *
14 ******************************************************************************/
15
16 define {
17 lcount = 12
18 }
19
20 text item( str rgb )
21 <TD ALIGN=CENTER><TABLE BGCOLOR=#\(rgb) WIDTH=60><TR><TD> </TD></TR></TABLE>
22 <FONT FACE="Courier">\(rgb)</FONT>
23 </TD>
24 \!
25
26 text colorhtm
27 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
28 <HTML><HEAD><TITLE>RGB colors for Web</TITLE></HEAD>
29 <BODY BGCOLOR=#FFFFFF><CENTER>
30 <TABLE BORDER=0 CELLPADDING=3 CELLSPACING=3><TR>
31 \{
32 int vrgb i j k
33 uint cur
34
35 subfunc outitem
36 {
37 str rgb
38
39 rgb.out4( "%06X", vrgb )
40 @ item( rgb )
41 if ++cur == $lcount
42 {
43 @"</TR><TR>"
44 cur = 0
45 }
46 }
47 for i = 0xFF, i >= 0, i -= 0x33
48 {
49 for j = 0xFF, j >= 0, j -= 0x33
50 {
51 for k = 0xFF, k >= 0, k -= 0x33
52 {
53 vrgb = ( i << 16 ) + ( j << 8 ) + k
54 outitem()
55 }
56 }
57 }
58 for vrgb = 0xFFFFFF, vrgb >= 0, vrgb -= 0x111111 : outitem()
59 for vrgb = 0xFF0000, vrgb > 0, vrgb -= 0x110000 : outitem()
60 for vrgb = 0x00FF00, vrgb > 0, vrgb -= 0x001100 : outitem()
61 for vrgb = 0x0000FF, vrgb > 0, vrgb -= 0x000011 : outitem()
62 }
63 </TR></TABLE> <BR>
64 Generated with Gentee Programming Language
65 </BODY></HTML>
66 \!
67
68 func color< main >
69 {
70 str out
71
72 out @ colorhtm()
73 out.write( "color.htm" )
74 shell( "color.htm" )
75 }
76