3D屏保:排色榜


3D屏保:排色榜

      排色榜,是一个针对图形学中的色彩进行排序的DEMO,这里的色是色彩的意思,看成别的点进来的同学请自觉面壁.该DEMO可以按RGB,GBR,BRG,灰度值四种方式进行排序.排序算法为冒泡排序,之所以选择这种排序算法,是因为该算法容易实现相邻两个颜色的交换旋转.

      前些天看到一个图片是关于四六级中关于颜色的单词和GRE中关于颜色的单词的对比.我突然想到有必要定义一套图形学中的色彩,然后将其一一摆列显示出来.这样当我写程序时想选择一个颜色时,启动该程序选就是了.记得我写自己的第一款游戏"Hello Color",为了找到10个对比度明显的颜色费了不少劲.有了这个DEMO,以后再设置颜色会方便很多.

颜色按RED的顺序排序:


颜色按GREEN的顺序排序:


颜色按BLUE的顺序排序:


"ColorSorterSPP.scr"全屏可执行程序
"ColorSorter.exe"窗口可执行程序

鼠标左键右键拖动,调节视角.
鼠标滚轮,调节摄像机的远近.
X,恢复为默认视角并停止视角旋转.
空格,P,暂停与恢复.
ESC,退出.


R 颜色按RED的顺序按步执行排列
G 颜色按GREEN的顺序按步执行排列
B 颜色按BLUE的顺序按步执行排列
I 颜色按其序号按步执行排列
Y 颜色按灰度值的顺序按步执行排列

CTRL+ R 颜色按RED的顺序排列,一次性完成
CTRL+ G 颜色按GREEN的顺序排列,一次性完成
CTRL+ B 颜色按BLUE的顺序排列,一次性完成
CTRL+ I 颜色按其序号排列,一次性完成
CTRL+ Y 颜色按灰度值的顺序排列,一次性完成

T 排色榜重新开始.
[ 减少颜色数目.最小为8
] 增加颜色数目.最多为140
L 开关灯光效果
= 下一个色彩交换
按下CTRL移动鼠标可以点选颜色信息.
配置文件WhyCore.ini中字段

[ColorSorter]
ColorCount = 32
表示默认初始的颜色数目为32

屏保设置方式
XP:
将目录下的所有文件拷贝到WINDOWS系统目录下如"C:WINDOWSsystem32"
WIN7,WIN8:
将目录下的所有文件拷贝到"C:WINDOWSSysWOW64"或"C:WINDOWSSysWOW32"目录下

在设置屏保的对话框中,选择"ColorSorterSP"

下载地址:

http://files.cnblogs.com/WhyEngine/ColorSorter_2_0.7z


140个颜色的宏定义如下:

  1 #define YD_COLOR_LIGHT_PINK             YD_RGB(255, 182, 193)        // 浅粉红
  2 #define YD_COLOR_PINK                   YD_RGB(255, 192, 203)        // 粉红
  3 #define YD_COLOR_CRIMSON_RED            YD_RGB(220,  20,  60)        // 猩红 (深红)
  4 #define YD_COLOR_LAVENDER_BLUSH         YD_RGB(255, 240, 245)        // 淡紫红
  5 #define YD_COLOR_PALE_VIOLET_RED        YD_RGB(219, 112, 147)        // 弱紫罗兰红
  6 #define YD_COLOR_HOT_PINK               YD_RGB(255, 105, 180)        // 热情的粉红
  7 #define YD_COLOR_DEEP_PINK              YD_RGB(255,  20, 147)        // 深粉红
  8 #define YD_COLOR_MEDIUM_VIOLET_RED      YD_RGB(199,  21, 133)        // 中紫罗兰红
  9 #define YD_COLOR_ORCHID                 YD_RGB(218, 112, 214)        // 兰花紫
 10 #define YD_COLOR_THISTLE                YD_RGB(216, 191, 216)        //
 11 #define YD_COLOR_PLUM                   YD_RGB(221, 160, 221)        // 李子紫
 12 #define YD_COLOR_VIOLET                 YD_RGB(238, 130, 238)        // 紫罗兰
 13 #define YD_COLOR_MAGENTA                YD_RGB(255,   0, 255)        // 洋红 (品红 玫瑰红)
 14 #define YD_COLOR_FUCHSIA                YD_RGB(255,   0, 255)        // 灯笼海棠(紫红色)
 15 #define YD_COLOR_DARK_MAGENTA           YD_RGB(139,   0, 139)        // 深洋红
 16 #define YD_COLOR_PURPLE                 YD_RGB(128,   0, 128)        // 紫色
 17 #define YD_COLOR_MEDIUM_ORCHID          YD_RGB(186,  85, 211)        // 中兰花紫
 18 #define YD_COLOR_DARK_VIOLET            YD_RGB(148,   0, 211)        // 暗紫罗兰
 19 #define YD_COLOR_DARK_ORCHID            YD_RGB(153,  50, 204)        // 暗兰花紫
 20 #define YD_COLOR_INDIGO                 YD_RGB( 75,   0, 130)        // 靛青 (紫兰色)
 21 #define YD_COLOR_BLUE_VIOLET            YD_RGB(138,  43, 226)        // 蓝紫罗兰
 22 #define YD_COLOR_MEDIUM_PURPLE          YD_RGB(147, 112, 219)        // 中紫色
 23 #define YD_COLOR_MEDIUM_SLATE_BLUE      YD_RGB(123, 104, 238)        // 中板岩蓝
 24 #define YD_COLOR_SLATE_BLUE             YD_RGB(106,  90, 205)        // 板岩蓝
 25 #define YD_COLOR_DARK_SLATE_BLUE        YD_RGB( 72,  61, 139)        // 暗板岩蓝
 26 #define YD_COLOR_LAVENDER               YD_RGB(230, 230, 250)        // 熏衣草淡紫
 27 #define YD_COLOR_GHOST_WHITE            YD_RGB(248, 248, 255)        // 幽灵白
 28 #define YD_COLOR_BLUE                   YD_RGB(  0,   0, 255)        // 纯蓝
 29 #define YD_COLOR_MEDIUM_BLUE            YD_RGB(  0,   0, 205)        // 中蓝色
 30 #define YD_COLOR_MIDNIGHT_BLUE          YD_RGB( 25,  25, 112)        // 午夜蓝
 31 #define YD_COLOR_DARK_BLUE              YD_RGB(  0,   0, 139)        // 暗蓝色
 32 #define YD_COLOR_NAVY_BLUE              YD_RGB(  0,   0, 128)        // 海军蓝
 33 #define YD_COLOR_ROYAL_BLUE             YD_RGB( 65, 105, 225)        // 皇家蓝 (宝蓝)
 34 #define YD_COLOR_CORN_FLOWER_BLUE       YD_RGB(100, 149, 237)        // 矢车菊蓝
 35 #define YD_COLOR_LIGHT_STEEL_BLUE       YD_RGB(176, 196, 222)        // 亮钢蓝
 36 #define YD_COLOR_LIGHT_SLATE_GRAY       YD_RGB(119, 136, 153)        // 亮石板灰
 37 #define YD_COLOR_SLATE_GRAY             YD_RGB(112, 128, 144)        // 石板灰
 38 #define YD_COLOR_DODGER_BLUE            YD_RGB( 30, 144, 255)        // 道奇蓝
 39 #define YD_COLOR_ALICE_BLUE             YD_RGB(240, 248, 255)        // 爱丽丝蓝
 40 #define YD_COLOR_STEEL_BLUE             YD_RGB( 70, 130, 180)        // 钢蓝 (铁青)
 41 #define YD_COLOR_LIGHT_SKY_BLUE         YD_RGB(135, 206, 250)        // 亮天蓝色
 42 #define YD_COLOR_SKY_BLUE               YD_RGB(135, 206, 235)        // 天蓝色
 43 #define YD_COLOR_DEEP_SKY_BLUE          YD_RGB(  0, 191, 255)        // 深天蓝
 44 #define YD_COLOR_LIGHT_BLUE             YD_RGB(173, 216, 230)        // 亮蓝
 45 #define YD_COLOR_POWDER_BLUE            YD_RGB(176, 224, 230)        // 火药青
 46 #define YD_COLOR_CADET_BLUE             YD_RGB( 95, 158, 160)        // 军服蓝
 47 #define YD_COLOR_AZURE                  YD_RGB(240, 255, 255)        // 蔚蓝色
 48 #define YD_COLOR_LIGHT_CYAN             YD_RGB(224, 255, 255)        // 淡青色
 49 #define YD_COLOR_PALE_TURQUOISE         YD_RGB(175, 238, 238)        // 弱绿宝石
 50 #define YD_COLOR_CYAN                   YD_RGB(  0, 255, 255)        // 青色
 51 #define YD_COLOR_AQUA                   YD_RGB(  0, 255, 255)        // 水色
 52 #define YD_COLOR_DARK_TURQUOISE         YD_RGB(  0, 206, 209)        // 暗绿宝石
 53 #define YD_COLOR_DARK_SLATE_GRAY        YD_RGB( 47,  79,  79)        // 暗石板灰
 54 #define YD_COLOR_DARK_CYAN              YD_RGB(  0, 139, 139)        // 暗青色
 55 #define YD_COLOR_TEAL                   YD_RGB(  0, 128, 128)        // 水鸭色
 56 #define YD_COLOR_MEDIUM_TURQUOISE       YD_RGB( 72, 209, 204)        // 中绿宝石
 57 #define YD_COLOR_LIGHT_SEA_GREEN        YD_RGB( 32, 178, 170)        // 浅海洋绿
 58 #define YD_COLOR_TURQUOISE              YD_RGB( 64, 224, 208)        // 绿宝石
 59 #define YD_COLOR_AQUAMARINE             YD_RGB(127, 255, 212)        // 宝石碧绿
 60 #define YD_COLOR_MEDIUM_AQUAMARINE      YD_RGB(102, 205, 170)        // 中宝石碧绿
 61 #define YD_COLOR_MEDIUM_SPRINGGREEN     YD_RGB(  0, 250, 154)        // 中春绿色
 62 #define YD_COLOR_MINT_CREAM             YD_RGB(245, 255, 250)        // 薄荷奶油
 63 #define YD_COLOR_SPRING_GREEN           YD_RGB(  0, 255, 127)        // 春绿色
 64 #define YD_COLOR_MEDIUM_SEA_GREEN       YD_RGB( 60, 179, 113)        // 中海洋绿
 65 #define YD_COLOR_SEA_GREEN              YD_RGB( 46, 139,  87)        // 海洋绿
 66 #define YD_COLOR_HONEYDEW               YD_RGB(240, 255, 240)        // 蜜瓜色
 67 #define YD_COLOR_LIGHT_GREEN            YD_RGB(144, 238, 144)        // 淡绿色
 68 #define YD_COLOR_PALE_GREEN             YD_RGB(152, 251, 152)        // 弱绿色
 69 #define YD_COLOR_DARK_SEA_GREEN         YD_RGB(143, 188, 143)        // 暗海洋绿
 70 #define YD_COLOR_LIME_GREEN             YD_RGB( 50, 205,  50)        // 闪光深绿
 71 #define YD_COLOR_LIME                   YD_RGB(  0, 255,   0)        // 闪光绿
 72 #define YD_COLOR_FOREST_GREEN           YD_RGB( 34, 139,  34)        // 森林绿
 73 #define YD_COLOR_GREEN                  YD_RGB(  0, 128,   0)        // 纯绿
 74 #define YD_COLOR_DARK_GREEN             YD_RGB(  0, 100,   0)        // 暗绿色
 75 #define YD_COLOR_CHARTREUSE             YD_RGB(127, 255,   0)        // 查特酒绿 (黄绿色)
 76 #define YD_COLOR_LAWN_GREEN             YD_RGB(124, 252,   0)        // 草坪绿
 77 #define YD_COLOR_GREEN_YELLOW           YD_RGB(173, 255,  47)        // 绿黄色
 78 #define YD_COLOR_DARK_OLIVE_GREEN       YD_RGB( 85, 107,  47)        // 暗橄榄绿
 79 #define YD_COLOR_YELLOW_GREEN           YD_RGB(154, 205,  50)        // 黄绿色
 80 #define YD_COLOR_OLIVE_DRAB             YD_RGB(107, 142,  35)        // 橄榄褐色
 81 #define YD_COLOR_BEIGE                  YD_RGB(245, 245, 220)        // 米色(灰棕色)
 82 #define YD_COLOR_LIGHT_GOLDENROD_YELLOW YD_RGB(250, 250, 210)        // 亮菊黄
 83 #define YD_COLOR_IVORY                  YD_RGB(255, 255, 240)        // 象牙
 84 #define YD_COLOR_LIGHT_YELLOW           YD_RGB(255, 255, 224)        // 浅黄色
 85 #define YD_COLOR_YELLOW                 YD_RGB(255, 255,   0)        // 纯黄
 86 #define YD_COLOR_OLIVE                  YD_RGB(128, 128,   0)        // 橄榄
 87 #define YD_COLOR_DARK_KHAKI             YD_RGB(189, 183, 107)        // 深卡叽布
 88 #define YD_COLOR_LEMON_CHIFFON          YD_RGB(255, 250, 205)        // 柠檬绸
 89 #define YD_COLOR_PALE_GOLDENROD         YD_RGB(238, 232, 170)        // 灰菊黄
 90 #define YD_COLOR_KHAKI                  YD_RGB(240, 230, 140)        // 卡叽布
 91 #define YD_COLOR_GOLD                   YD_RGB(255, 215,   0)        // 金色
 92 #define YD_COLOR_CORNSILK               YD_RGB(255, 248, 220)        // 玉米丝色 
 93 #define YD_COLOR_GOLDENROD              YD_RGB(218, 165,  32)        // 金菊黄 
 94 #define YD_COLOR_DARK_GOLDENROD         YD_RGB(184, 134,  11)        // 暗金菊黄 
 95 #define YD_COLOR_FLORAL_WHITE           YD_RGB(255, 250, 240)        // 花的白色 
 96 #define YD_COLOR_OLD_LACE               YD_RGB(253, 245, 230)        // 旧蕾丝 
 97 #define YD_COLOR_WHEAT                  YD_RGB(245, 222, 179)        // 小麦色 
 98 #define YD_COLOR_MOCCASIN               YD_RGB(255, 228, 181)        // 鹿皮靴 
 99 #define YD_COLOR_ORANGE                 YD_RGB(255, 165,   0)        // 橙色 
100 #define YD_COLOR_PAPAYA_WHIP            YD_RGB(255, 239, 213)        // 番木瓜 
101 #define YD_COLOR_BLANCHED_ALMOND        YD_RGB(255, 235, 205)        // 发白的杏仁色 
102 #define YD_COLOR_NAVAJO_WHITE           YD_RGB(255, 222, 173)        // 土著白 
103 #define YD_COLOR_ANTIQUE_WHITE          YD_RGB(250, 235, 215)        // 古董白 
104 #define YD_COLOR_TAN                    YD_RGB(210, 180, 140)        // 茶色 
105 #define YD_COLOR_BURLY_WOOD             YD_RGB(222, 184, 135)        // 硬木色 
106 #define YD_COLOR_BISQUE                 YD_RGB(255, 228, 196)        // 陶坯黄 
107 #define YD_COLOR_DARK_ORANGE            YD_RGB(255, 140,   0)        // 深橙色 
108 #define YD_COLOR_LINEN                  YD_RGB(250, 240, 230)        // 亚麻布 
109 #define YD_COLOR_PERU                   YD_RGB(205, 133,  63)        // 秘鲁 
110 #define YD_COLOR_PEACH_PUFF             YD_RGB(255, 218, 185)        // 桃肉色 
111 #define YD_COLOR_SANDY_BROWN            YD_RGB(244, 164,  96)        // 沙棕色 
112 #define YD_COLOR_CHOCOLATE              YD_RGB(210, 105,  30)        // 巧克力 
113 #define YD_COLOR_SADDLE_BROWN           YD_RGB(139,  69,  19)        // 马鞍棕色 
114 #define YD_COLOR_SEASHELL               YD_RGB(255, 245, 238)        // 海贝壳 
115 #define YD_COLOR_SIENNA                 YD_RGB(160,  82,  45)        // 黄土赭色 
116 #define YD_COLOR_LIGHT_SALMON           YD_RGB(255, 160, 122)        // 浅鲑鱼肉色 
117 #define YD_COLOR_CORAL                  YD_RGB(255, 127,  80)        // 珊瑚 
118 #define YD_COLOR_ORANGE_RED             YD_RGB(255,  69,   0)        // 橙红色 
119 #define YD_COLOR_DARK_SALMON            YD_RGB(233, 150, 122)        // 深鲜肉(鲑鱼)色 
120 #define YD_COLOR_TOMATO                 YD_RGB(255,  99,  71)        // 番茄红 
121 #define YD_COLOR_MISTY_ROSE             YD_RGB(255, 228, 225)        // 薄雾玫瑰 
122 #define YD_COLOR_SALMON                 YD_RGB(250, 128, 114)        // 鲜肉(鲑鱼)色 
123 #define YD_COLOR_SNOW                   YD_RGB(255, 250, 250)        //
124 #define YD_COLOR_LIGHT_CORAL            YD_RGB(240, 128, 128)        // 淡珊瑚色 
125 #define YD_COLOR_ROSY_BROWN             YD_RGB(188, 143, 143)        // 玫瑰棕色 
126 #define YD_COLOR_INDIAN_RED             YD_RGB(205,  92,  92)        // 印度红 
127 #define YD_COLOR_RED                    YD_RGB(255,   0,   0)        // 纯红 
128 #define YD_COLOR_BROWN                  YD_RGB(165,  42,  42)        // 棕色 
129 #define YD_COLOR_FIRE_BRICK             YD_RGB(178,  34,  34)        // 耐火砖 
130 #define YD_COLOR_DARK_RED               YD_RGB(139,   0,   0)        // 深红色 
131 #define YD_COLOR_MAROON                 YD_RGB(128,   0,   0)        // 栗色 
132 #define YD_COLOR_WHITE                  YD_RGB(255, 255, 255)        // 纯白 
133 #define YD_COLOR_WHITE_SMOKE            YD_RGB(245, 245, 245)        // 白烟 
134 #define YD_COLOR_GAINSBORO              YD_RGB(220, 220, 220)        // 庚斯博罗灰色 
135 #define YD_COLOR_LIGHT_GREY             YD_RGB(211, 211, 211)        // 浅灰色 
136 #define YD_COLOR_SILVER                 YD_RGB(192, 192, 192)        // 银灰色 
137 #define YD_COLOR_DARK_GRAY              YD_RGB(169, 169, 169)        // 深灰色 
138 #define YD_COLOR_GRAY                   YD_RGB(186, 183, 186)        // 灰色(*) 
139 #define YD_COLOR_DIM_GRAY               YD_RGB(105, 105, 105)        // 暗淡的灰色 
140 #define YD_COLOR_BLACK                  YD_RGB(  0,   0,   0)        // 纯黑 
原文地址:https://www.cnblogs.com/WhyEngine/p/3492804.html