随笔-103  评论-37  文章-0  trackbacks-0
<? 
//////////////////////////////////////////////////////// 
// 
// colors.php - 这个程序只是定义了一些颜色的名字。
//  
// Author: Claus Radloff 
//  
// 描述:定义了一个颜色名字的联合数组。每个实体是由一个颜
//    色的名字和其RGB的参数所组成。函数GetColor 用颜色名做
//    参数,并且返回一个由RGB颜色所组成的联合数组。
//
//   4/14/2000    Mouse Chen( litmouse@km169.net   )    Translate it to Chinese


  
$Colors = array

//  HTML 3.规范中所定义的颜色 
       "black"=>array"red"=>0x00,  "green"=>0x00,  "blue"=>0x00), 
       
"maroon"=>array"red"=>0x80,  "green"=>0x00,  "blue"=>0x00), 
       
"green"=>array"red"=>0x00,  "green"=>0x80,  "blue"=>0x00), 
       
"olive"=>array"red"=>0x80,  "green"=>0x80,  "blue"=>0x00), 
       
"navy"=>array"red"=>0x00,  "green"=>0x00,  "blue"=>0x80), 
       
"purple"=>array"red"=>0x80,  "green"=>0x00,  "blue"=>0x80), 
       
"teal"=>array"red"=>0x00,  "green"=>0x80,  "blue"=>0x80), 
       
"gray"=>array"red"=>0x80,  "green"=>0x80,  "blue"=>0x80), 
       
"silver"=>array"red"=>0xC0,  "green"=>0xC0,  "blue"=>0xC0), 
       
"red"=>array"red"=>0xFF,  "green"=>0x00,  "blue"=>0x00), 
       
"lime"=>array"red"=>0x00,  "green"=>0xFF,  "blue"=>0x00), 
       
"yellow"=>array"red"=>0xFF,  "green"=>0xFF,  "blue"=>0x00), 
       
"blue"=>array"red"=>0x00,  "green"=>0x00,  "blue"=>0xFF), 
       
"fuchsia"=>array"red"=>0xFF,  "green"=>0x00,  "blue"=>0xFF), 
       
"aqua"=>array"red"=>0x00,  "green"=>0xFF,  "blue"=>0xFF), 
       
"white"=>array"red"=>0xFF,  "green"=>0xFF,  "blue"=>0xFF), 

//  Netscape and IE所附加定义的颜色 
       "aliceblue"=>array"red"=>0xF0,  "green"=>0xF8,  "blue"=>0xFF), 
       
"antiquewhite"=>array"red"=>0xFA,  "green"=>0xEB,  "blue"=>0xD7), 
       
"aquamarine"=>array"red"=>0x7F,  "green"=>0xFF,  "blue"=>0xD4), 
       
"azure"=>array"red"=>0xF0,  "green"=>0xFF,  "blue"=>0xFF), 
       
"beige"=>array"red"=>0xF5,  "green"=>0xF5,  "blue"=>0xDC), 
       
"blueviolet"=>array"red"=>0x8A,  "green"=>0x2B,  "blue"=>0xE2), 
       
"brown"=>array"red"=>0xA5,  "green"=>0x2A,  "blue"=>0x2A), 
       
"burlywood"=>array"red"=>0xDE,  "green"=>0xB8,  "blue"=>0x87), 
       
"cadetblue"=>array"red"=>0x5F,  "green"=>0x9E,  "blue"=>0xA0), 
       
"chartreuse"=>array"red"=>0x7F,  "green"=>0xFF,  "blue"=>0x00), 
       
"chocolate"=>array"red"=>0xD2,  "green"=>0x69,  "blue"=>0x1E), 
       
"coral"=>array"red"=>0xFF,  "green"=>0x7F,  "blue"=>0x50), 
       
"cornflowerblue"=>array"red"=>0x64,  "green"=>0x95,  "blue"=>0xED), 
       
"cornsilk"=>array"red"=>0xFF,  "green"=>0xF8,  "blue"=>0xDC), 
       
"crimson"=>array"red"=>0xDC,  "green"=>0x14,  "blue"=>0x3C), 
       
"darkblue"=>array"red"=>0x00,  "green"=>0x00,  "blue"=>0x8B), 
       
"darkcyan"=>array"red"=>0x00,  "green"=>0x8B,  "blue"=>0x8B), 
       
"darkgoldenrod"=>array"red"=>0xB8,  "green"=>0x86,  "blue"=>0x0B), 
       
"darkgray"=>array"red"=>0xA9,  "green"=>0xA9,  "blue"=>0xA9), 
       
"darkgreen"=>array"red"=>0x00,  "green"=>0x64,  "blue"=>0x00), 
       
"darkkhaki"=>array"red"=>0xBD,  "green"=>0xB7,  "blue"=>0x6B), 
       
"darkmagenta"=>array"red"=>0x8B,  "green"=>0x00,  "blue"=>0x8B), 
       
"darkolivegreen"=>array"red"=>0x55,  "green"=>0x6B,  "blue"=>0x2F), 
       
"darkorange"=>array"red"=>0xFF,  "green"=>0x8C,  "blue"=>0x00), 
       
"darkorchid"=>array"red"=>0x99,  "green"=>0x32,  "blue"=>0xCC), 
       
"darkred"=>array"red"=>0x8B,  "green"=>0x00,  "blue"=>0x00), 
       
"darksalmon"=>array"red"=>0xE9,  "green"=>0x96,  "blue"=>0x7A), 
       
"darkseagreen"=>array"red"=>0x8F,  "green"=>0xBC,  "blue"=>0x8F), 
       
"darkslateblue"=>array"red"=>0x48,  "green"=>0x3D,  "blue"=>0x8B), 
       
"darkslategray"=>array"red"=>0x2F,  "green"=>0x4F,  "blue"=>0x4F), 
       
"darkturquoise"=>array"red"=>0x00,  "green"=>0xCE,  "blue"=>0xD1), 
       
"darkviolet"=>array"red"=>0x94,  "green"=>0x00,  "blue"=>0xD3), 
       
"deeppink"=>array"red"=>0xFF,  "green"=>0x14,  "blue"=>0x93), 
       
"deepskyblue"=>array"red"=>0x00,  "green"=>0xBF,  "blue"=>0xFF), 
       
"dimgray"=>array"red"=>0x69,  "green"=>0x69,  "blue"=>0x69), 
       
"dodgerblue"=>array"red"=>0x1E,  "green"=>0x90,  "blue"=>0xFF), 
       
"firebrick"=>array"red"=>0xB2,  "green"=>0x22,  "blue"=>0x22), 
       
"floralwhite"=>array"red"=>0xFF,  "green"=>0xFA,  "blue"=>0xF0), 
       
"forestgreen"=>array"red"=>0x22,  "green"=>0x8B,  "blue"=>0x22), 
       
"gainsboro"=>array"red"=>0xDC,  "green"=>0xDC,  "blue"=>0xDC), 
       
"ghostwhite"=>array"red"=>0xF8,  "green"=>0xF8,  "blue"=>0xFF), 
       
"gold"=>array"red"=>0xFF,  "green"=>0xD7,  "blue"=>0x00), 
       
"goldenrod"=>array"red"=>0xDA,  "green"=>0xA5,  "blue"=>0x20), 
       
"greenyellow"=>array"red"=>0xAD,  "green"=>0xFF,  "blue"=>0x2F), 
       
"honeydew"=>array"red"=>0xF0,  "green"=>0xFF,  "blue"=>0xF0), 
       
"hotpink"=>array"red"=>0xFF,  "green"=>0x69,  "blue"=>0xB4), 
       
"indianred"=>array"red"=>0xCD,  "green"=>0x5C,  "blue"=>0x5C), 
       
"indigo"=>array"red"=>0x4B,  "green"=>0x00,  "blue"=>0x82), 
       
"ivory"=>array"red"=>0xFF,  "green"=>0xFF,  "blue"=>0xF0), 
       
"khaki"=>array"red"=>0xF0,  "green"=>0xE6,  "blue"=>0x8C), 
       
"lavender"=>array"red"=>0xE6,  "green"=>0xE6,  "blue"=>0xFA), 
       
"lavenderblush"=>array"red"=>0xFF,  "green"=>0xF0,  "blue"=>0xF5), 
       
"lawngreen"=>array"red"=>0x7C,  "green"=>0xFC,  "blue"=>0x00), 
       
"lemonchiffon"=>array"red"=>0xFF,  "green"=>0xFA,  "blue"=>0xCD), 
       
"lightblue"=>array"red"=>0xAD,  "green"=>0xD8,  "blue"=>0xE6), 
       
"lightcoral"=>array"red"=>0xF0,  "green"=>0x80,  "blue"=>0x80), 
       
"lightcyan"=>array"red"=>0xE0,  "green"=>0xFF,  "blue"=>0xFF), 
       
"lightgoldenrodyellow"=>array"red"=>0xFA,  "green"=>0xFA,  "blue"=>0xD2), 
       
"lightgreen"=>array"red"=>0x90,  "green"=>0xEE,  "blue"=>0x90), 
       
"lightgrey"=>array"red"=>0xD3,  "green"=>0xD3,  "blue"=>0xD3), 
       
"lightpink"=>array"red"=>0xFF,  "green"=>0xB6,  "blue"=>0xC1), 
       
"lightsalmon"=>array"red"=>0xFF,  "green"=>0xA0,  "blue"=>0x7A), 
       
"lightseagreen"=>array"red"=>0x20,  "green"=>0xB2,  "blue"=>0xAA), 
       
"lightskyblue"=>array"red"=>0x87,  "green"=>0xCE,  "blue"=>0xFA), 
       
"lightslategray"=>array"red"=>0x77,  "green"=>0x88,  "blue"=>0x99), 
       
"lightsteelblue"=>array"red"=>0xB0,  "green"=>0xC4,  "blue"=>0xDE), 
       
"lightyellow"=>array"red"=>0xFF,  "green"=>0xFF,  "blue"=>0xE0), 
       
"limegreen"=>array"red"=>0x32,  "green"=>0xCD,  "blue"=>0x32), 
       
"linen"=>array"red"=>0xFA,  "green"=>0xF0,  "blue"=>0xE6), 
       
"mediumaquamarine"=>array"red"=>0x66,  "green"=>0xCD,  "blue"=>0xAA), 
       
"mediumblue"=>array"red"=>0x00,  "green"=>0x00,  "blue"=>0xCD), 
       
"mediumorchid"=>array"red"=>0xBA,  "green"=>0x55,  "blue"=>0xD3), 
       
"mediumpurple"=>array"red"=>0x93,  "green"=>0x70,  "blue"=>0xD0), 
       
"mediumseagreen"=>array"red"=>0x3C,  "green"=>0xB3,  "blue"=>0x71), 
       
"mediumslateblue"=>array"red"=>0x7B,  "green"=>0x68,  "blue"=>0xEE), 
       
"mediumspringgreen"=>array"red"=>0x00,  "green"=>0xFA,  "blue"=>0x9A), 
       
"mediumturquoise"=>array"red"=>0x48,  "green"=>0xD1,  "blue"=>0xCC), 
       
"mediumvioletred"=>array"red"=>0xC7,  "green"=>0x15,  "blue"=>0x85), 
       
"midnightblue"=>array"red"=>0x19,  "green"=>0x19,  "blue"=>0x70), 
       
"mintcream"=>array"red"=>0xF5,  "green"=>0xFF,  "blue"=>0xFA), 
       
"mistyrose"=>array"red"=>0xFF,  "green"=>0xE4,  "blue"=>0xE1), 
       
"moccasin"=>array"red"=>0xFF,  "green"=>0xE4,  "blue"=>0xB5), 
       
"navajowhite"=>array"red"=>0xFF,  "green"=>0xDE,  "blue"=>0xAD), 
       
"oldlace"=>array"red"=>0xFD,  "green"=>0xF5,  "blue"=>0xE6), 
       
"olivedrab"=>array"red"=>0x6B,  "green"=>0x8E,  "blue"=>0x23), 
       
"orange"=>array"red"=>0xFF,  "green"=>0xA5,  "blue"=>0x00), 
       
"orangered"=>array"red"=>0xFF,  "green"=>0x45,  "blue"=>0x00), 
       
"orchid"=>array"red"=>0xDA,  "green"=>0x70,  "blue"=>0xD6), 
       
"palegoldenrod"=>array"red"=>0xEE,  "green"=>0xE8,  "blue"=>0xAA), 
       
"palegreen"=>array"red"=>0x98,  "green"=>0xFB,  "blue"=>0x98), 
       
"paleturquoise"=>array"red"=>0xAF,  "green"=>0xEE,  "blue"=>0xEE), 
       
"palevioletred"=>array"red"=>0xDB,  "green"=>0x70,  "blue"=>0x93), 
       
"papayawhip"=>array"red"=>0xFF,  "green"=>0xEF,  "blue"=>0xD5), 
       
"peachpuff"=>array"red"=>0xFF,  "green"=>0xDA,  "blue"=>0xB9), 
       
"peru"=>array"red"=>0xCD,  "green"=>0x85,  "blue"=>0x3F), 
       
"pink"=>array"red"=>0xFF,  "green"=>0xC0,  "blue"=>0xCB), 
       
"plum"=>array"red"=>0xDD,  "green"=>0xA0,  "blue"=>0xDD), 
       
"powderblue"=>array"red"=>0xB0,  "green"=>0xE0,  "blue"=>0xE6), 
       
"rosybrown"=>array"red"=>0xBC,  "green"=>0x8F,  "blue"=>0x8F), 
       
"royalblue"=>array"red"=>0x41,  "green"=>0x69,  "blue"=>0xE1), 
       
"saddlebrown"=>array"red"=>0x8B,  "green"=>0x45,  "blue"=>0x13), 
       
"salmon"=>array"red"=>0xFA,  "green"=>0x80,  "blue"=>0x72), 
       
"sandybrown"=>array"red"=>0xF4,  "green"=>0xA4,  "blue"=>0x60), 
       
"seagreen"=>array"red"=>0x2E,  "green"=>0x8B,  "blue"=>0x57), 
       
"seashell"=>array"red"=>0xFF,  "green"=>0xF5,  "blue"=>0xEE), 
       
"sienna"=>array"red"=>0xA0,  "green"=>0x52,  "blue"=>0x2D), 
       
"skyblue"=>array"red"=>0x87,  "green"=>0xCE,  "blue"=>0xEB), 
       
"slateblue"=>array"red"=>0x6A,  "green"=>0x5A,  "blue"=>0xCD), 
       
"slategray"=>array"red"=>0x70,  "green"=>0x80,  "blue"=>0x90), 
       
"snow"=>array"red"=>0xFF,  "green"=>0xFA,  "blue"=>0xFA), 
       
"springgreen"=>array"red"=>0x00,  "green"=>0xFF,  "blue"=>0x7F), 
       
"steelblue"=>array"red"=>0x46,  "green"=>0x82,  "blue"=>0xB4), 
       
"tan"=>array"red"=>0xD2,  "green"=>0xB4,  "blue"=>0x8C), 
       
"thistle"=>array"red"=>0xD8,  "green"=>0xBF,  "blue"=>0xD8), 
       
"tomato"=>array"red"=>0xFF,  "green"=>0x63,  "blue"=>0x47), 
       
"turquoise"=>array"red"=>0x40,  "green"=>0xE0,  "blue"=>0xD0), 
       
"violet"=>array"red"=>0xEE,  "green"=>0x82,  "blue"=>0xEE), 
       
"wheat"=>array"red"=>0xF5,  "green"=>0xDE,  "blue"=>0xB3), 
       
"whitesmoke"=>array"red"=>0xF5,  "green"=>0xF5,  "blue"=>0xF5), 
       
"yellowgreen"=>array"red"=>0x9A,  "green"=>0xCD,  "blue"=>0x32)); 
     
     
// GetColor函数返回一个有关RGB三原色的联合数组
    function GetColor($Colorname
    { 
        
global $Colors
        
return $Colors[$Colorname]; 
    } 
?> 


我把颜色总结了一下
 "black"=>array( 0x000000),黑色
       "maroon"=>array( 0x800000), 栗色
       "green"=>array( 0x008000), 绿色
       "olive"=>array( 0x808000), 橄榄色
       "navy"=>array( 0x000080),  藏青色
       "purple"=>array( 0x800080), 紫色
       "teal"=>array( 0x008080), 凫蓝:适度或深色的带蓝色的绿色到呈绿色的蓝色
       "gray"=>array( 0x808080), 灰色
       "silver"=>array( 0xC0C0C0), 银色
       "red"=>array( 0xFF0000), 红色
       "lime"=>array( 0x00FF00), 
       "yellow"=>array( 0xFFFF00), 黄色
       "blue"=>array( 0x0000FF), 蓝色
       "fuchsia"=>array( 0xFF00FF), 紫红
       "aqua"=>array( 0x00FFFF), 浅绿色
       "white"=>array( 0xFFFFFF), 白色

//  Netscape and IE所附加定义的颜色
       "aliceblue"=>array( 0xF0F8FF),
       "antiquewhite"=>array( 0xFAEBD7),
       "aquamarine"=>array( 0x7FFFD4),
       "azure"=>array( 0xF0FFFF),
       "beige"=>array( 0xF5F5DC),
       "blueviolet"=>array( 0x8A2BE2),
       "brown"=>array( 0xA52A2A),
       "burlywood"=>array( 0xDEB887),
       "cadetblue"=>array( 0x5F9EA0),
       "chartreuse"=>array( 0x7FFF00),
       "chocolate"=>array( 0xD2691E),
       "coral"=>array( 0xFF7F50),
       "cornflowerblue"=>array( 0x6495ED),
       "cornsilk"=>array( 0xFFF8DC),
       "crimson"=>array( 0xDC143C),
       "darkblue"=>array( 0x00008B),
       "darkcyan"=>array( 0x008B8B),
       "darkgoldenrod"=>array( 0xB8860B),
       "darkgray"=>array( 0xA9A9A9),
       "darkgreen"=>array( 0x006400),
       "darkkhaki"=>array( 0xBDB76B),
       "darkmagenta"=>array( 0x8B008B),
       "darkolivegreen"=>array( 0x556B2F),
       "darkorange"=>array( 0xFF8C00),
       "darkorchid"=>array( 0x9932CC),
       "darkred"=>array( 0x8B0000),
       "darksalmon"=>array( 0xE9967A),
       "darkseagreen"=>array( 0x8FBC8F),
       "darkslateblue"=>array( 0x483D8B),
       "darkslategray"=>array( 0x2F4F4F),
       "darkturquoise"=>array( 0x00CED1),
       "darkviolet"=>array( 0x9400D3),
       "deeppink"=>array( 0xFF1493),
       "deepskyblue"=>array( 0x00BFFF),
       "dimgray"=>array( 0x696969),
       "dodgerblue"=>array( 0x1E90FF),
       "firebrick"=>array( 0xB22222),
       "floralwhite"=>array( 0xFxFAF0),
       "forestgreen"=>array( 0x228B22),
       "gainsboro"=>array( 0xDCDCDC),
       "ghostwhite"=>array( 0xF8F8FF),
       "gold"=>array( 0xFFD700),
       "goldenrod"=>array( 0xDAA520),
       "greenyellow"=>array( 0xADFF2F),
       "honeydew"=>array( 0xF0FFF0),
       "hotpink"=>array( 0xFF69B4),
       "indianred"=>array( 0xCD5C5C),
       "indigo"=>array( 0x4B0082),
       "ivory"=>array( 0xFFFFF0),
       "khaki"=>array( 0xF0E68C),
       "lavender"=>array( 0xE6E6FA),
       "lavenderblush"=>array( 0xFFF0F5),
       "lawngreen"=>array( 0x7CFC00),
       "lemonchiffon"=>array( 0xFFFACD),
       "lightblue"=>array( 0xADD8E6),
       "lightcoral"=>array( 0xF08080),
       "lightcyan"=>array( 0xE0FFFF),
       "lightgoldenrodyellow"=>array( 0xFAFAD2),
       "lightgreen"=>array( 0x90EE90),
       "lightgrey"=>array( 0xD3D3D3),
       "lightpink"=>array( 0xFFB6C1),
       "lightsalmon"=>array( 0xFFA07A),
       "lightseagreen"=>array( 0x20B2AA),
       "lightskyblue"=>array( 0x87CEFA),
       "lightslategray"=>array( 0x778899),
       "lightsteelblue"=>array( 0xB0C4DE),
       "lightyellow"=>array( 0xFFFFE0),
       "limegreen"=>array( 0x32CD32),
       "linen"=>array( 0xFAF0E6),
       "mediumaquamarine"=>array( 0x66CDAA),
       "mediumblue"=>array( 0x0000CD),
       "mediumorchid"=>array( 0xBA55D3),
       "mediumpurple"=>array( 0x9370D0),
       "mediumseagreen"=>array( 0x3CB371),
       "mediumslateblue"=>array( 0x7B68EE),
       "mediumspringgreen"=>array( 0x00FA9A),
       "mediumturquoise"=>array( 0x48D1CC),
       "mediumvioletred"=>array( 0xC71585),
       "midnightblue"=>array( 0x191970),
       "mintcream"=>array( 0xF5FFFA),
       "mistyrose"=>array( 0xFFE4E1),
       "moccasin"=>array( 0xFFE4B5),
       "navajowhite"=>array( 0xFFDEAD),
       "oldlace"=>array( 0xFDF5E6),
       "olivedrab"=>array( 0x6B8E23),
       "orange"=>array( 0xFFA500),
       "orangered"=>array( 0xFF4500),
       "orchid"=>array( 0xDA70D6),
       "palegoldenrod"=>array( 0xEEE8AA),
       "palegreen"=>array( 0x98FB98),
       "paleturquoise"=>array( 0xAFEEEE),
       "palevioletred"=>array( 0xDB7093),
       "papayawhip"=>array( 0xFFEFD5),
       "peachpuff"=>array( 0xFFDAB9),
       "peru"=>array( 0xCD853F),
       "pink"=>array( 0xFFC0CB),
       "plum"=>array( 0xDDA0DD),
       "powderblue"=>array( 0xB0E0E6),
       "rosybrown"=>array( 0xBC8F8F),
       "royalblue"=>array( 0x4169E1),
       "saddlebrown"=>array( 0x8B4513),
       "salmon"=>array( 0xFA8072),
       "sandybrown"=>array( 0xF4A460),
       "seagreen"=>array( 0x2E8B57),
       "seashell"=>array( 0xFFF5EE),
       "sienna"=>array( 0xA0522D),
       "skyblue"=>array( 0x87CEEB),
       "slateblue"=>array( 0x6A5ACD),
       "slategray"=>array( 0x708090),
       "snow"=>array( 0xFFFAFA),
       "springgreen"=>array( 0x00Fx7F),
       "steelblue"=>array( 0x4682B4),
       "tan"=>array( 0xD2B48C),
       "thistle"=>array( 0xD8BFD8),
       "tomato"=>array( 0xFF6347),
       "turquoise"=>array( 0x40E0D0),
       "violet"=>array( 0xEE82EE),
       "wheat"=>array( 0xF5DEB3),
       "whitesmoke"=>array( 0xF5F5F5),
       "yellowgreen"=>array( 0x9ACD32));

PHP 的一些例程 http://www.xfbbs.com/Book/PHP/PHP_1/index.html

posted on 2008-02-28 15:26 鱼有所思 阅读(4066) 评论(0)  编辑 收藏 引用 网摘 所属分类: PHP

只有注册用户登录后才能发表评论。
网站导航: