5

最近我一直在将 Visual Studio (C#) 项目转换为网络。其中一项功能涉及从 MS 标准调色板中进行选择的能力。

所以我需要一个十六进制的 MS 标准颜色列表。

4

3 回答 3

9

搜索后我找不到这些 ARGB 颜色的十六进制列表,所以我写了一些 JS 来为我转换它们。

我想我不能成为唯一需要这些的人,所以给你!

爱丽丝蓝#F0F8FF

古董白 #FAEBD7

水色#00FFFF

海蓝宝石#7FFFD4

天蓝色#F0FFFF

米色 #F5F5DC

素瓷#FFE4C4

黑色#000000

白杏仁#FFEBCD

蓝色#0000FF

蓝紫#8A2BE2

棕色 #A52A2A

BurlyWood #DEB887

少年蓝 #5F9EA0

黄绿色 #7FFF00

巧克力#D2691E

珊瑚#FF7F50

矢车菊蓝 #6495ED

玉米丝 #FFF8DC

深红色#DC143C

青色 #00FFFF

深蓝#00008B

深青色#008B8B

暗金棒#B8860B

深灰色 #A9A9A9

深绿色 #006400

深卡其色 #BDB76B

深洋红色 #8B008B

深橄榄绿#556B2F

深橙色 #FF8C00

黑兰花#9932CC

深红色 #8B0000

黑鲑鱼#E9967A

深海绿#8FBC8F

DarkSlateBlue #483D8B

DarkSlateGray #2F4F4F

深绿松石 #00CED1

暗紫#9400D3

DeepPink #FF1493

深天蓝#00BFFF

暗灰色 #696969

道奇蓝 #1E90FF

耐火砖#B22222

花白#FFFAF0

森林绿#228B22

紫红色#FF00FF

盖恩斯伯勒#DCDCDC

鬼白#F8F8FF

金#FFD700

一枝黄#DAA520

灰色 #808080

绿色#008000

绿黄#ADFF2F

蜜露#F0FFF0

HotPink #FF69B4

印度红#CD5C5C

靛蓝 #4B0082

象牙色#FFFFF0

卡其色 #F0E68C

薰衣草 #E6E6FA

薰衣草腮红 #FFF0F5

草坪绿#7CFC00

柠檬雪纺#FFFACD

浅蓝色 #ADD8E6

光珊瑚#F08080

浅青色#E0FFFF

LightGoldenrodYellow #FAFAD2

浅灰色#D3D3D3

浅绿色 #90EE90

浅粉色#FFB6C1

淡鲑鱼#FFA07A

浅海绿#20B2AA

天蓝#87CEFA

LightSlateGray #778899

LightSteelBlue #B0C4DE

浅黄色#FFFFE0

石灰 #00FF00

青柠#32CD32

亚麻布#FAF0E6

洋红色 #FF00FF

栗色 #800000

中等海蓝宝石#66CDAA

中蓝#0000CD

中兰花#BA55D3

中紫#9370DB

中海绿#3CB371

中石板蓝#7B68EE

中春绿#00FA9A

中绿松石 #48D1CC

中紫红#C71585

午夜蓝 #191970

薄荷奶油#F5FFFA

MistyRose #FFE4E1

莫卡辛鞋 #FFE4B5

纳瓦霍白人#FFDEAD

海军 #000080

旧花边 #FDF5E6

橄榄 #808000

橄榄色#6B8E23

橙色#FFA500

橙红#FF4500

兰花#DA70D6

PaleGoldenrod #EEE8AA

淡绿色 #98FB98

浅绿松石色#AFEEEE

淡紫红色#DB7093

木瓜鞭#FFEFD5

桃子泡芙#FFDAB9

秘鲁#CD853F

粉色#FFC0CB

李子 #DDA0DD

粉蓝#B0E0E6

紫色 #800080

红色#FF0000

玫红#BC8F8F

宝蓝#4169E1

鞍棕色 #8B4513

三文鱼#FA8072

SandyBrown #F4A460

海绿#2E8B57

贝壳#FFF5EE

西耶娜 #A0522D

银色 #C0C0C0

天蓝#87CEEB

板岩蓝 #6A5ACD

板岩灰 #708090

雪#FFFAFA

春绿#00FF7F

钢蓝#4682B4

棕褐色#D2B48C

蓝绿色 #008080

蓟#D8BFD8

番茄#FF6347

透明 无

绿松石 #40E0D0

紫罗兰色#EE82EE

小麦#F5DEB3

白色#FFFFFF

白烟#F5F5F5

黄色#FFFF00

黄绿#9ACD32

或者作为一个 CSS 类块:

.AliceBlue{background-color:#F0F8FF;}
.AntiqueWhite{background-color:#FAEBD7;}
.Aqua{background-color:#00FFFF;}
.Aquamarine{background-color:#7FFFD4;}
.Azure{background-color:#F0FFFF;}
.Beige{background-color:#F5F5DC;}
.Bisque{background-color:#FFE4C4;}
.Black{background-color:#000000;}
.BlanchedAlmond{background-color:#FFEBCD;}
.Blue{background-color:#0000FF;}
.BlueViolet{background-color:#8A2BE2;}
.Brown{background-color:#A52A2A;}
.BurlyWood{background-color:#DEB887;}
.CadetBlue{background-color:#5F9EA0;}
.Chartreuse{background-color:#7FFF00;}
.Chocolate{background-color:#D2691E;}
.Coral{background-color:#FF7F50;}
.CornflowerBlue{background-color:#6495ED;}
.Cornsilk{background-color:#FFF8DC;}
.Crimson{background-color:#DC143C;}
.Cyan{background-color:#00FFFF;}
.DarkBlue{background-color:#00008B;}
.DarkCyan{background-color:#008B8B;}
.DarkGoldenrod{background-color:#B8860B;}
.DarkGray{background-color:#A9A9A9;}
.DarkGreen{background-color:#006400;}
.DarkKhaki{background-color:#BDB76B;}
.DarkMagenta{background-color:#8B008B;}
.DarkOliveGreen{background-color:#556B2F;}
.DarkOrange{background-color:#FF8C00;}
.DarkOrchid{background-color:#9932CC;}
.DarkRed{background-color:#8B0000;}
.DarkSalmon{background-color:#E9967A;}
.DarkSeaGreen{background-color:#8FBC8F;}
.DarkSlateBlue{background-color:#483D8B;}
.DarkSlateGray{background-color:#2F4F4F;}
.DarkTurquoise{background-color:#00CED1;}
.DarkViolet{background-color:#9400D3;}
.DeepPink{background-color:#FF1493;}
.DeepSkyBlue{background-color:#00BFFF;}
.DimGray{background-color:#696969;}
.DodgerBlue{background-color:#1E90FF;}
.Firebrick{background-color:#B22222;}
.FloralWhite{background-color:#FFFAF0;}
.ForestGreen{background-color:#228B22;}
.Fuchsia{background-color:#FF00FF;}
.Gainsboro{background-color:#DCDCDC;}
.GhostWhite{background-color:#F8F8FF;}
.Gold{background-color:#FFD700;}
.Goldenrod{background-color:#DAA520;}
.Gray{background-color:#808080;}
.Green{background-color:#008000;}
.GreenYellow{background-color:#ADFF2F;}
.Honeydew{background-color:#F0FFF0;}
.HotPink{background-color:#FF69B4;}
.IndianRed{background-color:#CD5C5C;}
.Indigo{background-color:#4B0082;}
.Ivory{background-color:#FFFFF0;}
.Khaki{background-color:#F0E68C;}
.Lavender{background-color:#E6E6FA;}
.LavenderBlush{background-color:#FFF0F5;}
.LawnGreen{background-color:#7CFC00;}
.LemonChiffon{background-color:#FFFACD;}
.LightBlue{background-color:#ADD8E6;}
.LightCoral{background-color:#F08080;}
.LightCyan{background-color:#E0FFFF;}
.LightGoldenrodYellow{background-color:#FAFAD2;}
.LightGray{background-color:#D3D3D3;}
.LightGreen{background-color:#90EE90;}
.LightPink{background-color:#FFB6C1;}
.LightSalmon{background-color:#FFA07A;}
.LightSeaGreen{background-color:#20B2AA;}
.LightSkyBlue{background-color:#87CEFA;}
.LightSlateGray{background-color:#778899;}
.LightSteelBlue{background-color:#B0C4DE;}
.LightYellow{background-color:#FFFFE0;}
.Lime{background-color:#00FF00;}
.LimeGreen{background-color:#32CD32;}
.Linen{background-color:#FAF0E6;}
.Magenta{background-color:#FF00FF;}
.Maroon{background-color:#800000;}
.MediumAquamarine{background-color:#66CDAA;}
.MediumBlue{background-color:#0000CD;}
.MediumOrchid{background-color:#BA55D3;}
.MediumPurple{background-color:#9370DB;}
.MediumSeaGreen{background-color:#3CB371;}
.MediumSlateBlue{background-color:#7B68EE;}
.MediumSpringGreen{background-color:#00FA9A;}
.MediumTurquoise{background-color:#48D1CC;}
.MediumVioletRed{background-color:#C71585;}
.MidnightBlue{background-color:#191970;}
.MintCream{background-color:#F5FFFA;}
.MistyRose{background-color:#FFE4E1;}
.Moccasin{background-color:#FFE4B5;}
.NavajoWhite{background-color:#FFDEAD;}
.Navy{background-color:#000080;}
.OldLace{background-color:#FDF5E6;}
.Olive{background-color:#808000;}
.OliveDrab{background-color:#6B8E23;}
.Orange{background-color:#FFA500;}
.OrangeRed{background-color:#FF4500;}
.Orchid{background-color:#DA70D6;}
.PaleGoldenrod{background-color:#EEE8AA;}
.PaleGreen{background-color:#98FB98;}
.PaleTurquoise{background-color:#AFEEEE;}
.PaleVioletRed{background-color:#DB7093;}
.PapayaWhip{background-color:#FFEFD5;}
.PeachPuff{background-color:#FFDAB9;}
.Peru{background-color:#CD853F;}
.Pink{background-color:#FFC0CB;}
.Plum{background-color:#DDA0DD;}
.PowderBlue{background-color:#B0E0E6;}
.Purple{background-color:#800080;}
.Red{background-color:#FF0000;}
.RosyBrown{background-color:#BC8F8F;}
.RoyalBlue{background-color:#4169E1;}
.SaddleBrown{background-color:#8B4513;}
.Salmon{background-color:#FA8072;}
.SandyBrown{background-color:#F4A460;}
.SeaGreen{background-color:#2E8B57;}
.SeaShell{background-color:#FFF5EE;}
.Sienna{background-color:#A0522D;}
.Silver{background-color:#C0C0C0;}
.SkyBlue{background-color:#87CEEB;}
.SlateBlue{background-color:#6A5ACD;}
.SlateGray{background-color:#708090;}
.Snow{background-color:#FFFAFA;}
.SpringGreen{background-color:#00FF7F;}
.SteelBlue{background-color:#4682B4;}
.Tan{background-color:#D2B48C;}
.Teal{background-color:#008080;}
.Thistle{background-color:#D8BFD8;}
.Tomato{background-color:#FF6347;}
.Transparent{background-color:none;}
.Turquoise{background-color:#40E0D0;}
.Violet{background-color:#EE82EE;}
.Wheat{background-color:#F5DEB3;}
.White{background-color:#FFFFFF;}
.WhiteSmoke{background-color:#F5F5F5;}
.Yellow{background-color:#FFFF00;}
.YellowGreen{background-color:#9ACD32;}

将 ARGB 转换为 HEX 的代码

if (!Array.prototype.forEach)
{
  Array.prototype.forEach = function(fun /*, thisp*/)
  {
    var len = this.length;
    if (typeof fun != "function")
      throw new TypeError();

    var thisp = arguments[1];
    for (var i = 0; i < len; i++)
    {
      if (i in this)
        fun.call(thisp, this[i], i, this);
    }
  };
}


var colors;
colors = new Array; 

colors.push("#FFF0F8FF","#FFFAEBD7","#FF00FFFF","#FF7FFFD4","#FFF0FFFF","#FFF5F5DC","#FFFFE4C4","#FF000000","#FFFFEBCD","#FF0000FF","#FF8A2BE2","#FFA52A2A","#FFDEB887","#FF5F9EA0","#FF7FFF00","#FFD2691E","#FFFF7F50","#FF6495ED","#FFFFF8DC","#FFDC143C","#FF00FFFF","#FF00008B","#FF008B8B","#FFB8860B","#FFA9A9A9","#FF006400","#FFBDB76B","#FF8B008B","#FF556B2F","#FFFF8C00","#FF9932CC","#FF8B0000","#FFE9967A","#FF8FBC8F","#FF483D8B","#FF2F4F4F","#FF00CED1","#FF9400D3","#FFFF1493","#FF00BFFF","#FF696969","#FF1E90FF","#FFB22222","#FFFFFAF0","#FF228B22","#FFFF00FF","#FFDCDCDC","#FFF8F8FF","#FFFFD700","#FFDAA520","#FF808080","#FF008000","#FFADFF2F","#FFF0FFF0","#FFFF69B4","#FFCD5C5C","#FF4B0082","#FFFFFFF0","#FFF0E68C","#FFE6E6FA","#FFFFF0F5","#FF7CFC00","#FFFFFACD","#FFADD8E6","#FFF08080","#FFE0FFFF","#FFFAFAD2","#FFD3D3D3","#FF90EE90","#FFFFB6C1","#FFFFA07A","#FF20B2AA","#FF87CEFA","#FF778899","#FFB0C4DE","#FFFFFFE0","#FF00FF00","#FF32CD32","#FFFAF0E6","#FFFF00FF","#FF800000","#FF66CDAA","#FF0000CD","#FFBA55D3","#FF9370DB","#FF3CB371","#FF7B68EE","#FF00FA9A","#FF48D1CC","#FFC71585","#FF191970","#FFF5FFFA","#FFFFE4E1","#FFFFE4B5","#FFFFDEAD","#FF000080","#FFFDF5E6","#FF808000","#FF6B8E23","#FFFFA500","#FFFF4500","#FFDA70D6","#FFEEE8AA","#FF98FB98","#FFAFEEEE","#FFDB7093","#FFFFEFD5","#FFFFDAB9","#FFCD853F","#FFFFC0CB","#FFDDA0DD","#FFB0E0E6","#FF800080","#FFFF0000","#FFBC8F8F","#FF4169E1","#FF8B4513","#FFFA8072","#FFF4A460","#FF2E8B57","#FFFFF5EE","#FFA0522D","#FFC0C0C0","#FF87CEEB","#FF6A5ACD","#FF708090","#FFFFFAFA","#FF00FF7F","#FF4682B4","#FFD2B48C","#FF008080","#FFD8BFD8","#FFFF6347","","#FF40E0D0","#FFEE82EE","#FFF5DEB3","#FFFFFFFF","#FFF5F5F5","#FFFFFF00","#FF9ACD32")

var newColor = "";

function switchColor(element, index, array) {
   newColor += '#' + element.substring(3) + ','; 
}

colors.forEach(switchColor);
于 2012-08-16T14:01:30.487 回答
0

作为额外的奖励,我还希望每种颜色的颜色稍暗一点,以用作边框。我合并了一些 JS 来获得我需要的东西:

稍暗的版本:

爱丽丝蓝#d2e1da

AntiqueWhite #dcb9cd

水族#00e1e1

海蓝宝石#61b6e1

天蓝色#d2e1e1

米色 #d7bed7

浓汤#e1a6c6

黑色#000000

白杏仁#e1afcd

蓝色 #00e100

蓝紫#6cc40d

棕色 #870c0c

BurlyWood #c0699a

CadetBlue #418280

黄绿色 #6100e1

巧克力#b4004b

珊瑚#e13261

矢车菊蓝 #46cf77

玉米丝#e1beda

深红色#be1e00

青色 #00e1e1

深蓝 #006d00

深青色 #006d6d

DarkGoldenrod #9a0068

深灰色 #8b8b8b

深绿色 #000046

深卡其色 #9f4d99

深洋红色 #6d6d00

DarkOliveGreen #37114d

深橙色#e1006e

黑兰花#7bae14

暗红色 #6d0000

黑鲑鱼#cb5c78

深海绿#71719e

DarkSlateBlue #2a6d1f

DarkSlateGray #113131

深绿松石 #00b3b0

暗紫色 #76b500

深粉色#e17500

深天蓝 #00e1a1

暗灰色 #4b4b4b

道奇蓝 #00e172

耐火砖 #940404

花白色#e1d2dc

ForestGreen #04046d

紫红色#e1e100

盖恩斯伯勒#bebebe

鬼白#dae1da

金#e100b9

一枝黄花#bc0287

灰色 #626262

绿色#000062

绿黄#8f11e1

蜜露#d2d2e1

HotPink #e1964b

印度红#af3e3e

靛蓝 #2d6400

象牙色#e1d2e1

卡其色 #d26ec8

薰衣草 #c8dcc8

薰衣草腮红 #e1d7d2

草坪绿#5e00de

柠檬雪纺#e1afdc

浅蓝色 #8fc8ba

光珊瑚#d26262

浅青色#c2e1e1

LightGoldenrodYellow #dcb4dc

浅灰色#b5b5b5

浅绿色 #7272d0

浅粉色#e1a398

淡鲑鱼#e15c82

浅海绿 #028c94

天蓝#69dcb0

LightSlateGray #597b6a

轻钢蓝色 #92c0a6

淡黄色#e1c2e1

石灰 #0000e1

青柠#1414af

亚麻布 #dcc8d2

洋红色 #e1e100

栗色 #620000

中等海蓝宝石#488caf

中蓝#00af00

中兰花#9cb537

中紫#75bd52

中海绿#1e5395

中石板蓝#5dd04a

中春绿#007cdc

中绿松石 #2aaeb3

中紫红色#a96700

午夜蓝 #005200

薄荷奶油#d7dce1

迷雾玫瑰#e1c3c6

莫卡辛鞋 #e197c6

纳瓦霍白 #e18fc0

海军 #006200

旧花边 #dfc8d7

橄榄 #620062

橄榄色 #4d0570

橙色 #e10087

橙红#e10027

兰花#bcb852

PaleGoldenrod #d08cca

淡绿色 #7a7add

淡绿松石 #91d0d0

淡紫红色#bd7552

木瓜鞭#e1b7d1

桃子泡芙#e19bbc

秘鲁 #af2167

粉色#e1ada2

梅花#bfbf82

粉蓝#92c8c2

紫色 #626200

红色#e10000

玫瑰色棕色 #9e7171

宝蓝#23c34b

鞍棕色 #6d0027

三文鱼 #dc5462

桑迪布朗 #d64286

海绿#10396d

贝壳#e1d0d7

西耶娜 #820f34

银色 #a2a2a2

天蓝#69cdb0

板岩蓝#4caf3c

板岩灰 #527262

雪#e1dcdc

春绿#0061e1

钢蓝#289664

谭#b46e96

蓝绿色 #006262

蓟#babaa1

番茄#e12945

透明 #000000

绿松石 #22b2c2

紫罗兰色#d0d064

小麦#d795c0

白色#e1e1e1

白烟#d7d7d7

黄色#e100e1

黄绿#7c14af

作为 CSS 块,使用较暗的版本作为边框:

.AliceBlue{background-color:#F0F8FF;border:1px solid #d2e1da;}
.AntiqueWhite{background-color:#FAEBD7;border:1px solid #dcb9cd;}
.Aqua{background-color:#00FFFF;border:1px solid #00e1e1;}
.Aquamarine{background-color:#7FFFD4;border:1px solid #61b6e1;}
.Azure{background-color:#F0FFFF;border:1px solid #d2e1e1;}
.Beige{background-color:#F5F5DC;border:1px solid #d7bed7;}
.Bisque{background-color:#FFE4C4;border:1px solid #e1a6c6;}
.Black{background-color:#000000;border:1px solid #000000;}
.BlanchedAlmond{background-color:#FFEBCD;border:1px solid #e1afcd;}
.Blue{background-color:#0000FF;border:1px solid #00e100;}
.BlueViolet{background-color:#8A2BE2;border:1px solid #6cc40d;}
.Brown{background-color:#A52A2A;border:1px solid #870c0c;}
.BurlyWood{background-color:#DEB887;border:1px solid #c0699a;}
.CadetBlue{background-color:#5F9EA0;border:1px solid #418280;}
.Chartreuse{background-color:#7FFF00;border:1px solid #6100e1;}
.Chocolate{background-color:#D2691E;border:1px solid #b4004b;}
.Coral{background-color:#FF7F50;border:1px solid #e13261;}
.CornflowerBlue{background-color:#6495ED;border:1px solid #46cf77;}
.Cornsilk{background-color:#FFF8DC;border:1px solid #e1beda;}
.Crimson{background-color:#DC143C;border:1px solid #be1e00;}
.Cyan{background-color:#00FFFF;border:1px solid #00e1e1;}
.DarkBlue{background-color:#00008B;border:1px solid #006d00;}
.DarkCyan{background-color:#008B8B;border:1px solid #006d6d;}
.DarkGoldenrod{background-color:#B8860B;border:1px solid #9a0068;}
.DarkGray{background-color:#A9A9A9;border:1px solid #8b8b8b;}
.DarkGreen{background-color:#006400;border:1px solid #000046;}
.DarkKhaki{background-color:#BDB76B;border:1px solid #9f4d99;}
.DarkMagenta{background-color:#8B008B;border:1px solid #6d6d00;}
.DarkOliveGreen{background-color:#556B2F;border:1px solid #37114d;}
.DarkOrange{background-color:#FF8C00;border:1px solid #e1006e;}
.DarkOrchid{background-color:#9932CC;border:1px solid #7bae14;}
.DarkRed{background-color:#8B0000;border:1px solid #6d0000;}
.DarkSalmon{background-color:#E9967A;border:1px solid #cb5c78;}
.DarkSeaGreen{background-color:#8FBC8F;border:1px solid #71719e;}
.DarkSlateBlue{background-color:#483D8B;border:1px solid #2a6d1f;}
.DarkSlateGray{background-color:#2F4F4F;border:1px solid #113131;}
.DarkTurquoise{background-color:#00CED1;border:1px solid #00b3b0;}
.DarkViolet{background-color:#9400D3;border:1px solid #76b500;}
.DeepPink{background-color:#FF1493;border:1px solid #e17500;}
.DeepSkyBlue{background-color:#00BFFF;border:1px solid #00e1a1;}
.DimGray{background-color:#696969;border:1px solid #4b4b4b;}
.DodgerBlue{background-color:#1E90FF;border:1px solid #00e172;}
.Firebrick{background-color:#B22222;border:1px solid #940404;}
.FloralWhite{background-color:#FFFAF0;border:1px solid #e1d2dc;}
.ForestGreen{background-color:#228B22;border:1px solid #04046d;}
.Fuchsia{background-color:#FF00FF;border:1px solid #e1e100;}
.Gainsboro{background-color:#DCDCDC;border:1px solid #bebebe;}
.GhostWhite{background-color:#F8F8FF;border:1px solid #dae1da;}
.Gold{background-color:#FFD700;border:1px solid #e100b9;}
.Goldenrod{background-color:#DAA520;border:1px solid #bc0287;}
.Gray{background-color:#808080;border:1px solid #626262;}
.Green{background-color:#008000;border:1px solid #000062;}
.GreenYellow{background-color:#ADFF2F;border:1px solid #8f11e1;}
.Honeydew{background-color:#F0FFF0;border:1px solid #d2d2e1;}
.HotPink{background-color:#FF69B4;border:1px solid #e1964b;}
.IndianRed{background-color:#CD5C5C;border:1px solid #af3e3e;}
.Indigo{background-color:#4B0082;border:1px solid #2d6400;}
.Ivory{background-color:#FFFFF0;border:1px solid #e1d2e1;}
.Khaki{background-color:#F0E68C;border:1px solid #d26ec8;}
.Lavender{background-color:#E6E6FA;border:1px solid #c8dcc8;}
.LavenderBlush{background-color:#FFF0F5;border:1px solid #e1d7d2;}
.LawnGreen{background-color:#7CFC00;border:1px solid #5e00de;}
.LemonChiffon{background-color:#FFFACD;border:1px solid #e1afdc;}
.LightBlue{background-color:#ADD8E6;border:1px solid #8fc8ba;}
.LightCoral{background-color:#F08080;border:1px solid #d26262;}
.LightCyan{background-color:#E0FFFF;border:1px solid #c2e1e1;}
.LightGoldenrodYellow{background-color:#FAFAD2;border:1px solid #dcb4dc;}
.LightGray{background-color:#D3D3D3;border:1px solid #b5b5b5;}
.LightGreen{background-color:#90EE90;border:1px solid #7272d0;}
.LightPink{background-color:#FFB6C1;border:1px solid #e1a398;}
.LightSalmon{background-color:#FFA07A;border:1px solid #e15c82;}
.LightSeaGreen{background-color:#20B2AA;border:1px solid #028c94;}
.LightSkyBlue{background-color:#87CEFA;border:1px solid #69dcb0;}
.LightSlateGray{background-color:#778899;border:1px solid #597b6a;}
.LightSteelBlue{background-color:#B0C4DE;border:1px solid #92c0a6;}
.LightYellow{background-color:#FFFFE0;border:1px solid #e1c2e1;}
.Lime{background-color:#00FF00;border:1px solid #0000e1;}
.LimeGreen{background-color:#32CD32;border:1px solid #1414af;}
.Linen{background-color:#FAF0E6;border:1px solid #dcc8d2;}
.Magenta{background-color:#FF00FF;border:1px solid #e1e100;}
.Maroon{background-color:#800000;border:1px solid #620000;}
.MediumAquamarine{background-color:#66CDAA;border:1px solid #488caf;}
.MediumBlue{background-color:#0000CD;border:1px solid #00af00;}
.MediumOrchid{background-color:#BA55D3;border:1px solid #9cb537;}
.MediumPurple{background-color:#9370DB;border:1px solid #75bd52;}
.MediumSeaGreen{background-color:#3CB371;border:1px solid #1e5395;}
.MediumSlateBlue{background-color:#7B68EE;border:1px solid #5dd04a;}
.MediumSpringGreen{background-color:#00FA9A;border:1px solid #007cdc;}
.MediumTurquoise{background-color:#48D1CC;border:1px solid #2aaeb3;}
.MediumVioletRed{background-color:#C71585;border:1px solid #a96700;}
.MidnightBlue{background-color:#191970;border:1px solid #005200;}
.MintCream{background-color:#F5FFFA;border:1px solid #d7dce1;}
.MistyRose{background-color:#FFE4E1;border:1px solid #e1c3c6;}
.Moccasin{background-color:#FFE4B5;border:1px solid #e197c6;}
.NavajoWhite{background-color:#FFDEAD;border:1px solid #e18fc0;}
.Navy{background-color:#000080;border:1px solid #006200;}
.OldLace{background-color:#FDF5E6;border:1px solid #dfc8d7;}
.Olive{background-color:#808000;border:1px solid #620062;}
.OliveDrab{background-color:#6B8E23;border:1px solid #4d0570;}
.Orange{background-color:#FFA500;border:1px solid #e10087;}
.OrangeRed{background-color:#FF4500;border:1px solid #e10027;}
.Orchid{background-color:#DA70D6;border:1px solid #bcb852;}
.PaleGoldenrod{background-color:#EEE8AA;border:1px solid #d08cca;}
.PaleGreen{background-color:#98FB98;border:1px solid #7a7add;}
.PaleTurquoise{background-color:#AFEEEE;border:1px solid #91d0d0;}
.PaleVioletRed{background-color:#DB7093;border:1px solid #bd7552;}
.PapayaWhip{background-color:#FFEFD5;border:1px solid #e1b7d1;}
.PeachPuff{background-color:#FFDAB9;border:1px solid #e19bbc;}
.Peru{background-color:#CD853F;border:1px solid #af2167;}
.Pink{background-color:#FFC0CB;border:1px solid #e1ada2;}
.Plum{background-color:#DDA0DD;border:1px solid #bfbf82;}
.PowderBlue{background-color:#B0E0E6;border:1px solid #92c8c2;}
.Purple{background-color:#800080;border:1px solid #626200;}
.Red{background-color:#FF0000;border:1px solid #e10000;}
.RosyBrown{background-color:#BC8F8F;border:1px solid #9e7171;}
.RoyalBlue{background-color:#4169E1;border:1px solid #23c34b;}
.SaddleBrown{background-color:#8B4513;border:1px solid #6d0027;}
.Salmon{background-color:#FA8072;border:1px solid #dc5462;}
.SandyBrown{background-color:#F4A460;border:1px solid #d64286;}
.SeaGreen{background-color:#2E8B57;border:1px solid #10396d;}
.SeaShell{background-color:#FFF5EE;border:1px solid #e1d0d7;}
.Sienna{background-color:#A0522D;border:1px solid #820f34;}
.Silver{background-color:#C0C0C0;border:1px solid #a2a2a2;}
.SkyBlue{background-color:#87CEEB;border:1px solid #69cdb0;}
.SlateBlue{background-color:#6A5ACD;border:1px solid #4caf3c;}
.SlateGray{background-color:#708090;border:1px solid #527262;}
.Snow{background-color:#FFFAFA;border:1px solid #e1dcdc;}
.SpringGreen{background-color:#00FF7F;border:1px solid #0061e1;}
.SteelBlue{background-color:#4682B4;border:1px solid #289664;}
.Tan{background-color:#D2B48C;border:1px solid #b46e96;}
.Teal{background-color:#008080;border:1px solid #006262;}
.Thistle{background-color:#D8BFD8;border:1px solid #babaa1;}
.Tomato{background-color:#FF6347;border:1px solid #e12945;}
.Transparent{background-color:none;border:1px solid #000000;}
.Turquoise{background-color:#40E0D0;border:1px solid #22b2c2;}
.Violet{background-color:#EE82EE;border:1px solid #d0d064;}
.Wheat{background-color:#F5DEB3;border:1px solid #d795c0;}
.White{background-color:#FFFFFF;border:1px solid #e1e1e1;}
.WhiteSmoke{background-color:#F5F5F5;border:1px solid #d7d7d7;}
.Yellow{background-color:#FFFF00;border:1px solid #e100e1;}
.YellowGreen{background-color:#9ACD32;border:1px solid #7c14af;}

使颜色变暗的脚本

if (!Array.prototype.forEach)
{
  Array.prototype.forEach = function(fun /*, thisp*/)
  {
    var len = this.length;
    if (typeof fun != "function")
      throw new TypeError();

    var thisp = arguments[1];
    for (var i = 0; i < len; i++)
    {
      if (i in this)
        fun.call(thisp, this[i], i, this);
    }
  };
}


var colors;
colors = new Array; 

colors.push("#FFF0F8FF","#FFFAEBD7","#FF00FFFF","#FF7FFFD4","#FFF0FFFF","#FFF5F5DC","#FFFFE4C4","#FF000000","#FFFFEBCD","#FF0000FF","#FF8A2BE2","#FFA52A2A","#FFDEB887","#FF5F9EA0","#FF7FFF00","#FFD2691E","#FFFF7F50","#FF6495ED","#FFFFF8DC","#FFDC143C","#FF00FFFF","#FF00008B","#FF008B8B","#FFB8860B","#FFA9A9A9","#FF006400","#FFBDB76B","#FF8B008B","#FF556B2F","#FFFF8C00","#FF9932CC","#FF8B0000","#FFE9967A","#FF8FBC8F","#FF483D8B","#FF2F4F4F","#FF00CED1","#FF9400D3","#FFFF1493","#FF00BFFF","#FF696969","#FF1E90FF","#FFB22222","#FFFFFAF0","#FF228B22","#FFFF00FF","#FFDCDCDC","#FFF8F8FF","#FFFFD700","#FFDAA520","#FF808080","#FF008000","#FFADFF2F","#FFF0FFF0","#FFFF69B4","#FFCD5C5C","#FF4B0082","#FFFFFFF0","#FFF0E68C","#FFE6E6FA","#FFFFF0F5","#FF7CFC00","#FFFFFACD","#FFADD8E6","#FFF08080","#FFE0FFFF","#FFFAFAD2","#FFD3D3D3","#FF90EE90","#FFFFB6C1","#FFFFA07A","#FF20B2AA","#FF87CEFA","#FF778899","#FFB0C4DE","#FFFFFFE0","#FF00FF00","#FF32CD32","#FFFAF0E6","#FFFF00FF","#FF800000","#FF66CDAA","#FF0000CD","#FFBA55D3","#FF9370DB","#FF3CB371","#FF7B68EE","#FF00FA9A","#FF48D1CC","#FFC71585","#FF191970","#FFF5FFFA","#FFFFE4E1","#FFFFE4B5","#FFFFDEAD","#FF000080","#FFFDF5E6","#FF808000","#FF6B8E23","#FFFFA500","#FFFF4500","#FFDA70D6","#FFEEE8AA","#FF98FB98","#FFAFEEEE","#FFDB7093","#FFFFEFD5","#FFFFDAB9","#FFCD853F","#FFFFC0CB","#FFDDA0DD","#FFB0E0E6","#FF800080","#FFFF0000","#FFBC8F8F","#FF4169E1","#FF8B4513","#FFFA8072","#FFF4A460","#FF2E8B57","#FFFFF5EE","#FFA0522D","#FFC0C0C0","#FF87CEEB","#FF6A5ACD","#FF708090","#FFFFFAFA","#FF00FF7F","#FF4682B4","#FFD2B48C","#FF008080","#FFD8BFD8","#FFFF6347","","#FF40E0D0","#FFEE82EE","#FFF5DEB3","#FFFFFFFF","#FFF5F5F5","#FFFFFF00","#FF9ACD32")


var newColor = "";

function switchColor(element, index, array) {
   newColor += "#" + DarkenLightenColor(element.substring(3),30) + ",";
}


colors.forEach(switchColor);


newColor;



function DarkenLightenColor(col,amt) {
    var usePound = false;
    if ( col[0] == "#" ) {
        col = col.slice(1);
        usePound = true;
    }

    var num = parseInt(col,16);

    var r = (num >> 16) - amt;

    if ( r > 255 ) r = 255;
    else if  (r < 0) r = 0;

    var b = ((num >> 8) & 0x00FF) - amt;

    if ( b > 255 ) b = 255;
    else if  (b < 0) b = 0;

    var g = (num & 0x0000FF) - amt;

    if ( g > 255 ) g = 255;
    else if  ( g < 0 ) g = 0;
var rStr = (r.toString(16).length < 2)?'0'+r.toString(16):r.toString(16);
var gStr = (g.toString(16).length < 2)?'0'+g.toString(16):g.toString(16);
var bStr = (b.toString(16).length < 2)?'0'+b.toString(16):b.toString(16);

return (usePound?"#":"") + rStr + gStr + bStr;
}
于 2012-08-16T14:22:38.580 回答
0

检查以下链接,

http://msdn.microsoft.com/en-us/library/system.windows.media.colors.aspx

它包含所有系统定义颜色的 ARGB 值。

于 2012-08-16T14:25:19.563 回答