ColorName to RGB function

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4981
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

ColorName to RGB function

Post by dunbarx » Thu Jul 17, 2014 6:27 pm

This came up in another thread. The OP wanted to be able to:

answer colorNameToRGB("red") -- yields "255,0,0"

Now there is no such native LC function. Should there be? Ought it also handle HTM-style color?

The engine already knows how to do this. If I set the backColor of a button to "Azure 2", I can then go to the "colors and patterns" pane of the inspector, select the "RGB Slider" for the "fill" color, and read the three values.

Craig Newman

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1968
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: ColorName to RGB function

Post by richmond62 » Wed Dec 16, 2015 8:01 pm

Aah: BUT, how can I get a stack to access those values rather than using my eyes?

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3978
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: ColorName to RGB function

Post by jacque » Wed Dec 16, 2015 9:40 pm

You could dig around in the IDE to find out how they do it. Or you could use a hack if you know the coordinates where the color is applied:

Code: Select all

put the mouseloc into tOrigLoc
set the mouseloc to x,y -- location of the color
put the mousecolor into tRGB
set the mouseloc to tOrigLoc
It's ugly, but it's so fast you don't need to lock the screen.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1553
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: ColorName to RGB function

Post by [-hh] » Thu Dec 17, 2015 3:15 am

Excerpt from RaspberryPi stacks #40 and #41.

Code: Select all

function hhColorNamesInfo
  # OUTPUT lines: item 1=colorName, 2-4=RGB, 5=Hex, 6-8=HSV, 9=Dec
  return "AliceBlue,239,247,255,#EFF7FF,66,6,100,15726591" &cr& \
        "AntiqueWhite,249,232,210,#F9E8D2,1,15,97,16378066" &cr& \
        "AntiqueWhite1,254,237,214,#FEEDD6,1,15,99,16707030" &cr& \
        "AntiqueWhite2,235,219,197,#EBDBC5,1,16,92,15457221" &cr& \
        "AntiqueWhite3,200,185,166,#C8B9A6,1,16,78,13154726" &cr& \
        "AntiqueWhite4,129,116,104,#817468,1,19,50,8483944" &cr& \
        "Aquamarine,67,183,186,#43B7BA,56,63,72,4437946" &cr& \
        "Aquamarine1,127,255,212,#7FFFD4,38,50,100,8388564" &cr& \
        "Aquamarine2,118,238,198,#76EEC6,38,50,93,7794374" &cr& \
        "Aquamarine3,102,205,170,#66CDAA,38,50,80,6737322" &cr& \
        "Aquamarine4,65,124,100,#417C64,38,47,48,4291684" &cr& \
        "Azure,239,255,255,#EFFFFF,34,6,100,15728639" &cr& \
        "Azure1,239,255,255,#EFFFFF,34,6,100,15728639" &cr& \
        "Azure2,222,236,236,#DEECEC,34,5,92,14609644" &cr& \
        "Azure3,188,199,199,#BCC7C7,34,5,78,12371911" &cr& \
        "Azure4,122,125,125,#7A7D7D,33,2,49,8027517" &cr& \
        "Beige,245,243,215,#F5F3D7,1,12,96,16118743" &cr& \
        "Bisque,255,228,196,#FFE4C4,2,23,100,16770244" &cr& \
        "Bisque1,253,224,188,#FDE0BC,2,25,99,16638140" &cr& \
        "Bisque2,234,208,174,#EAD0AE,2,25,91,15388846" &cr& \
        "Bisque3,199,175,146,#C7AF92,2,26,78,13086610" &cr& \
        "Bisque4,129,110,89,#816E59,2,31,50,8482393" &cr& \
        "Black,0,0,0,#000000,0,0,0,0" &cr& \
        "BlanchedAlmond,254,232,198,#FEE8C6,2,22,99,16705734" &cr& \
        "Blue,0,0,255,#0000FF,66,100,100,255" &cr& \
        "Blue1,21,53,255,#1535FF,64,91,100,1390079" &cr& \
        "Blue2,21,49,236,#1531EC,64,91,92,1389036" &cr& \
        "Blue3,21,40,199,#1528C7,65,89,78,1386695" &cr& \
        "Blue4,21,27,126,#151B7E,65,83,49,1383294" &cr& \
        "BlueViolet,138,43,226,#8A2BE2,73,80,88,9055202" &cr& \
        "Brown,152,5,23,#980517,98,96,59,9962775" &cr& \
        "Brown1,246,53,38,#F63526,1,84,96,16135462" &cr& \
        "Brown2,228,45,23,#E42D17,1,89,89,14953751" &cr& \
        "Brown3,194,34,23,#C22217,0,88,76,12722711" &cr& \
        "Brown4,126,5,23,#7E0517,97,96,49,8258839" &cr& \
        "Burlywood,216,175,121,#D8AF79,4,43,84,14200697" &cr& \
        "Burlywood1,252,206,142,#FCCE8E,4,43,98,16567950" &cr& \
        "Burlywood2,234,190,131,#EABE83,4,44,91,15384195" &cr& \
        "Burlywood3,198,160,109,#C6A06D,4,44,77,13017197" &cr& \
        "Burlywood4,128,99,65,#806341,4,49,50,8414017" &cr& \
        "CadetBlue,87,134,147,#578693,61,40,57,5736083" &cr& \
        "CadetBlue1,152,245,255,#98F5FF,60,40,100,10024447" &cr& \
        "CadetBlue2,142,226,236,#8EE2EC,60,39,92,9364204" &cr& \
        "CadetBlue3,119,191,199,#77BFC7,60,40,78,7847879" &cr& \
        "CadetBlue4,76,120,126,#4C787E,60,39,49,5011582" &cr& \
        "Chartreuse,127,255,0,#7FFF00,25,100,100,8388352" &cr& \
        "Chartreuse1,127,255,0,#7FFF00,25,100,100,8388352" &cr& \
        "Chartreuse2,118,238,0,#76EE00,25,100,93,7794176" &cr& \
        "Chartreuse3,102,205,0,#66CD00,25,100,80,6737152" &cr& \
        "Chartreuse4,67,124,23,#437C17,27,81,48,4422679" &cr& \
        "Chocolate,200,90,23,#C85A17,5,88,78,13130263" &cr& \
        "Chocolate1,248,114,23,#F87217,6,90,97,16282135" &cr& \
        "Chocolate2,229,103,23,#E56717,5,89,89,15034135" &cr& \
        "Chocolate3,195,86,23,#C35617,5,88,76,12801559" &cr& \
        "Chocolate4,126,49,23,#7E3117,3,81,49,8270103" &cr& \
        "Coral,247,101,65,#F76541,2,73,96,16213313" &cr& \
        "Coral1,247,101,65,#F76541,2,73,96,16213313" &cr& \
        "Coral2,229,91,60,#E55B3C,2,73,89,15031100" &cr& \
        "Coral3,195,74,44,#C34A2C,2,77,76,12798508" &cr& \
        "Coral4,126,40,23,#7E2817,2,81,49,8267799" &cr& \
        "CornflowerBlue,100,149,237,#6495ED,63,57,92,6591981" &cr& \
        "CornSilk,255,247,215,#FFF7D7,2,15,100,16775127" &cr& \
        "CornSilk1,255,247,215,#FFF7D7,2,15,100,16775127" &cr& \
        "CornSilk2,236,229,198,#ECE5C6,2,16,92,15525318" &cr& \
        "CornSilk3,200,194,167,#C8C2A7,2,16,78,13157031" &cr& \
        "CornSilk4,129,122,104,#817A68,2,19,50,8485480" &cr& \
        "Cyan,0,255,255,#00FFFF,50,100,100,65535" &cr& \
        "Cyan1,87,254,255,#57FEFF,55,65,100,5766911" &cr& \
        "Cyan2,80,235,236,#50EBEC,55,66,92,5303276" &cr& \
        "Cyan3,70,199,199,#46C7C7,44,64,78,4638663" &cr& \
        "Cyan4,48,125,126,#307D7E,56,61,49,3177854" &cr& \
        "DarkBlue,0,0,139,#00008B,66,100,54,139" &cr& \
        "DarkCyan,0,139,139,#008B8B,50,100,54,35723" &cr& \
        "DarkGoldenrod,175,120,23,#AF7817,9,86,68,11499543" &cr& \
        "DarkGoldenrod1,251,177,23,#FBB117,10,90,98,16494871" &cr& \
        "DarkGoldenrod2,232,163,23,#E8A317,10,90,90,15246103" &cr& \
        "DarkGoldenrod3,197,137,23,#C58917,9,88,77,12945687" &cr& \
        "DarkGoldenrod4,127,82,23,#7F5217,7,81,49,8344087" &cr& \
        "DarkGray,169,169,169,#A9A9A9,0,0,66,11119017" &cr& \
        "DarkGreen,0,100,0,#006400,33,100,39,25600" &cr& \
        "DarkKhaki,183,173,89,#B7AD59,7,51,71,12037465" &cr& \
        "DarkMagenta,139,0,139,#8B008B,83,100,54,9109643" &cr& \
        "DarkOliveGreen,74,65,23,#4A4117,9,68,29,4866327" &cr& \
        "DarkOliveGreen1,202,255,112,#CAFF70,27,56,100,13303664" &cr& \
        "DarkOliveGreen2,188,233,84,#BCE954,25,63,91,12380500" &cr& \
        "DarkOliveGreen3,160,197,68,#A0C544,25,65,77,10536260" &cr& \
        "DarkOliveGreen4,102,124,38,#667C26,24,69,48,6716454" &cr& \
        "DarkOrange,248,128,23,#F88017,7,90,97,16285719" &cr& \
        "DarkOrange1,248,114,23,#F87217,6,90,97,16282135" &cr& \
        "DarkOrange2,229,103,23,#E56717,5,89,89,15034135" &cr& \
        "DarkOrange3,195,86,23,#C35617,5,88,76,12801559" &cr& \
        "DarkOrange4,126,49,23,#7E3117,3,81,49,8270103" &cr& \
        "DarkOrchid,125,27,126,#7D1B7E,79,78,49,8199038" &cr& \
        "DarkOrchid1,176,65,255,#B041FF,73,74,100,11551231" &cr& \
        "DarkOrchid2,162,59,236,#A23BEC,73,74,92,10632172" &cr& \
        "DarkOrchid3,139,49,199,#8B31C7,74,75,78,9122247" &cr& \
        "DarkOrchid4,104,34,139,#68228B,75,75,54,6824587" &cr& \
        "DarkRed,139,0,0,#8B0000,0,100,54,9109504" &cr& \
        "DarkSalmon,225,139,107,#E18B6B,2,52,88,14781291" &cr& \
        "DarkSeaGreen,139,179,129,#8BB381,32,27,70,9155457" &cr& \
        "DarkSeaGreen1,193,255,193,#C1FFC1,33,24,100,12713921" &cr& \
        "DarkSeaGreen2,180,238,180,#B4EEB4,33,24,93,11857588" &cr& \
        "DarkSeaGreen3,153,198,142,#99C68E,32,28,77,10077838" &cr& \
        "DarkSeaGreen4,105,139,105,#698B69,33,24,54,6916969" &cr& \
        "DarkSlateBlue,43,56,86,#2B3856,64,50,33,2832470" &cr& \
        "DarkSlateGray,37,56,60,#25383C,61,38,23,2439228" &cr& \
        "DarkSlateGray1,151,255,255,#97FFFF,40,40,100,9961471" &cr& \
        "DarkSlateGray2,141,238,238,#8DEEEE,40,40,93,9301742" &cr& \
        "DarkSlateGray3,120,199,199,#78C7C7,39,39,78,7915463" &cr& \
        "DarkSlateGray4,76,125,126,#4C7D7E,60,39,49,5012862" &cr& \
        "DarkTurquoise,59,156,156,#3B9C9C,43,62,61,3906716" &cr& \
        "DarkViolet,132,45,206,#842DCE,73,78,80,8662478" &cr& \
        "DeepPink,245,40,135,#F52887,93,83,96,16066695" &cr& \
        "DeepPink1,255,20,147,#FF1493,91,92,100,16716947" &cr& \
        "DeepPink2,228,40,124,#E4287C,93,82,89,14952572" &cr& \
        "DeepPink3,193,34,103,#C12267,94,82,75,12657255" &cr& \
        "DeepPink4,125,5,63,#7D053F,92,96,49,8193343" &cr& \
        "DeepSkyBlue,0,191,255,#00BFFF,54,100,100,49151" &cr& \
        "DeepSkyBlue1,59,185,255,#3BB9FF,58,76,100,3914239" &cr& \
        "DeepSkyBlue2,0,178,238,#00B2EE,54,100,93,45806" &cr& \
        "DeepSkyBlue3,0,154,205,#009ACD,54,100,80,39629" &cr& \
        "DeepSkyBlue4,0,104,139,#00688B,54,100,54,26763" &cr& \
        "DimGray,70,62,65,#463E41,99,11,27,4603457" &cr& \
        "DodgerBlue,21,137,255,#1589FF,59,91,100,1411583" &cr& \
        "DodgerBlue1,30,144,255,#1E90FF,59,88,100,2003199" &cr& \
        "DodgerBlue2,28,134,238,#1C86EE,59,88,93,1869550" &cr& \
        "DodgerBlue3,24,116,205,#1874CD,59,88,80,1602765" &cr& \
        "DodgerBlue4,16,78,139,#104E8B,59,88,54,1068683" &cr& \
        "Firebrick,128,5,23,#800517,97,96,50,8389911" &cr& \
        "Firebrick1,246,40,23,#F62817,1,90,96,16132119" &cr& \
        "Firebrick2,228,34,23,#E42217,0,89,89,14950935" &cr& \
        "Firebrick3,193,27,23,#C11B17,0,88,75,12655383" &cr& \
        "Firebrick4,126,5,23,#7E0517,97,96,49,8258839" &cr& \
        "FloralWhite,255,249,238,#FFF9EE,0,6,100,16775662" &cr& \
        "ForestGreen,34,139,34,#228B22,33,75,54,2263842" &cr& \
        "Gainsboro,216,217,215,#D8D9D7,33,0,85,14211543" &cr& \
        "GhostWhite,247,247,255,#F7F7FF,66,3,100,16250879" &cr& \
        "Gold,212,160,23,#D4A017,10,89,83,13934615" &cr& \
        "Gold1,253,208,23,#FDD017,12,90,99,16633879" &cr& \
        "Gold2,234,193,23,#EAC117,12,90,91,15384855" &cr& \
        "Gold3,199,163,23,#C7A317,11,88,78,13083415" &cr& \
        "Gold4,128,101,23,#806517,10,82,50,8414487" &cr& \
        "Goldenrod,218,165,32,#DAA520,10,85,85,14329120" &cr& \
        "Goldenrod1,251,185,23,#FBB917,10,90,98,16496919" &cr& \
        "Goldenrod2,233,171,23,#E9AB17,10,90,91,15313687" &cr& \
        "Goldenrod3,198,142,23,#C68E17,10,88,77,13012503" &cr& \
        "Goldenrod4,128,88,23,#805817,8,82,50,8411159" &cr& \
        "Gray,190,190,190,#BEBEBE,0,0,74,12500670" &cr& \
        "Gray0,0,0,0,#000000,0,0,0,0" &cr& \
        "Gray1,21,5,23,#150517,78,78,9,1377559" &cr& \
        "Gray10,21,5,23,#150517,78,78,9,1377559" &cr& \
        "Gray100,255,255,255,#FFFFFF,0,0,100,16777215" &cr& \
        "Gray11,21,5,23,#150517,78,78,9,1377559" &cr& \
        "Gray12,21,5,23,#150517,78,78,9,1377559" &cr& \
        "Gray13,21,5,23,#150517,78,78,9,1377559" &cr& \
        "Gray14,21,5,23,#150517,78,78,9,1377559" &cr& \
        "Gray15,21,5,23,#150517,78,78,9,1377559" &cr& \
        "Gray16,21,5,23,#150517,78,78,9,1377559" &cr& \
        "Gray17,21,5,23,#150517,78,78,9,1377559" &cr& \
        "Gray18,37,5,23,#250517,91,86,14,2426135" &cr& \
        "Gray19,37,5,23,#250517,91,86,14,2426135" &cr& \
        "Gray2,21,5,23,#150517,78,78,9,1377559" &cr& \
        "Gray20,37,5,23,#250517,91,86,14,2426135" &cr& \
        "Gray21,43,27,23,#2B1B17,1,46,16,2824983" &cr& \
        "Gray22,43,27,23,#2B1B17,1,46,16,2824983" &cr& \
        "Gray23,48,34,23,#302217,3,52,18,3154455" &cr& \
        "Gray24,48,34,38,#302226,98,29,18,3154470" &cr& \
        "Gray25,52,40,38,#342826,0,26,20,3418150" &cr& \
        "Gray26,52,40,44,#34282C,98,23,20,3418156" &cr& \
        "Gray27,56,45,44,#382D2C,0,21,21,3681580" &cr& \
        "Gray28,59,49,49,#3B3131,0,16,23,3879217" &cr& \
        "Gray29,62,53,53,#3E3535,0,14,24,4076853" &cr& \
        "Gray3,21,5,23,#150517,78,78,9,1377559" &cr& \
        "Gray30,65,56,57,#413839,99,13,25,4274233" &cr& \
        "Gray31,65,56,60,#41383C,98,13,25,4274236" &cr& \
        "Gray32,70,62,63,#463E3F,99,11,27,4603455" &cr& \
        "Gray33,70,62,65,#463E41,99,11,27,4603457" &cr& \
        "Gray34,74,67,68,#4A4344,99,9,29,4866884" &cr& \
        "Gray35,76,70,70,#4C4646,0,7,29,4998726" &cr& \
        "Gray36,78,72,72,#4E4848,0,7,30,5130312" &cr& \
        "Gray37,80,74,75,#504A4B,99,7,31,5261899" &cr& \
        "Gray38,84,78,79,#544E4F,99,7,32,5525071" &cr& \
        "Gray39,86,80,81,#565051,99,6,33,5656657" &cr& \
        "Gray4,10,10,10,#0A0A0A,0,0,3,657930" &cr& \
        "Gray40,102,102,102,#666666,0,0,40,6710886" &cr& \
        "Gray41,105,105,105,#696969,0,0,41,6908265" &cr& \
        "Gray42,107,107,107,#6B6B6B,0,0,41,7039851" &cr& \
        "Gray43,110,110,110,#6E6E6E,0,0,43,7237230" &cr& \
        "Gray44,100,96,96,#646060,0,4,39,6578272" &cr& \
        "Gray45,102,99,98,#666362,0,3,40,6710114" &cr& \
        "Gray46,105,101,101,#696565,0,3,41,6907237" &cr& \
        "Gray47,109,105,104,#6D6968,0,4,42,7170408" &cr& \
        "Gray48,110,106,107,#6E6A6B,99,3,43,7236203" &cr& \
        "Gray49,114,110,109,#726E6D,0,4,44,7499373" &cr& \
        "Gray5,13,13,13,#0D0D0D,0,0,5,855309" &cr& \
        "Gray50,116,113,112,#747170,0,3,45,7631216" &cr& \
        "Gray51,120,116,115,#787473,0,4,47,7894131" &cr& \
        "Gray52,122,119,119,#7A7777,0,2,47,8025975" &cr& \
        "Gray53,124,121,121,#7C7979,0,2,48,8157561" &cr& \
        "Gray54,128,125,124,#807D7C,0,3,50,8420732" &cr& \
        "Gray55,130,128,126,#82807E,0,3,50,8552574" &cr& \
        "Gray56,133,131,129,#858381,0,3,52,8749953" &cr& \
        "Gray57,135,133,131,#878583,0,2,52,8881539" &cr& \
        "Gray58,139,137,135,#8B8987,0,2,54,9144711" &cr& \
        "Gray59,141,139,137,#8D8B89,0,2,55,9276297" &cr& \
        "Gray6,15,15,15,#0F0F0F,0,0,5,986895" &cr& \
        "Gray60,143,142,141,#8F8E8D,0,1,56,9408141" &cr& \
        "Gray61,147,145,144,#939190,0,2,57,9671056" &cr& \
        "Gray62,149,148,146,#959492,0,2,58,9802898" &cr& \
        "Gray63,153,151,149,#999795,0,2,60,10065813" &cr& \
        "Gray64,154,153,152,#9A9998,0,1,60,10131864" &cr& \
        "Gray65,158,156,155,#9E9C9B,0,1,61,10394779" &cr& \
        "Gray66,160,159,157,#A09F9D,0,1,62,10526621" &cr& \
        "Gray67,163,162,160,#A3A2A0,0,1,63,10724000" &cr& \
        "Gray68,165,164,163,#A5A4A3,0,1,64,10855587" &cr& \
        "Gray69,169,168,166,#A9A8A6,0,1,66,11118758" &cr& \
        "Gray7,18,18,18,#121212,0,0,7,1184274" &cr& \
        "Gray70,172,171,169,#ACABA9,0,1,67,11316137" &cr& \
        "Gray71,174,173,172,#AEADAC,0,1,68,11447724" &cr& \
        "Gray72,177,177,175,#B1B1AF,0,1,69,11645359" &cr& \
        "Gray73,179,179,177,#B3B3B1,0,1,70,11776945" &cr& \
        "Gray74,183,182,180,#B7B6B4,0,1,71,12039860" &cr& \
        "Gray75,185,184,182,#B9B8B6,0,1,72,12171446" &cr& \
        "Gray76,188,187,186,#BCBBBA,0,1,73,12368826" &cr& \
        "Gray77,190,190,188,#BEBEBC,0,1,74,12500668" &cr& \
        "Gray78,193,193,191,#C1C1BF,0,1,75,12698047" &cr& \
        "Gray79,195,196,194,#C3C4C2,33,1,76,12829890" &cr& \
        "Gray8,20,20,20,#141414,0,0,7,1315860" &cr& \
        "Gray80,199,199,197,#C7C7C5,0,1,78,13092805" &cr& \
        "Gray81,202,202,201,#CACAC9,0,0,79,13290185" &cr& \
        "Gray82,204,204,203,#CCCCCB,0,0,80,13421771" &cr& \
        "Gray83,208,207,207,#D0CFCF,0,0,81,13684687" &cr& \
        "Gray84,210,210,209,#D2D2D1,0,0,82,13816529" &cr& \
        "Gray85,213,213,212,#D5D5D4,0,0,83,14013908" &cr& \
        "Gray86,215,215,215,#D7D7D7,0,0,84,14145495" &cr& \
        "Gray87,219,219,217,#DBDBD9,0,0,85,14408665" &cr& \
        "Gray88,221,221,220,#DDDDDC,0,0,86,14540252" &cr& \
        "Gray89,224,224,224,#E0E0E0,0,0,87,14737632" &cr& \
        "Gray9,21,5,23,#150517,78,78,9,1377559" &cr& \
        "Gray90,226,227,225,#E2E3E1,33,0,89,14869473" &cr& \
        "Gray91,229,230,228,#E5E6E4,33,0,90,15066852" &cr& \
        "Gray92,232,233,232,#E8E9E8,33,0,91,15264232" &cr& \
        "Gray93,235,235,234,#EBEBEA,0,0,92,15461354" &cr& \
        "Gray94,238,238,238,#EEEEEE,0,0,93,15658734" &cr& \
        "Gray95,240,241,240,#F0F1F0,33,0,94,15790576" &cr& \
        "Gray96,244,244,243,#F4F4F3,0,0,95,16053491" &cr& \
        "Gray97,246,246,245,#F6F6F5,0,0,96,16185077" &cr& \
        "Gray98,249,249,250,#F9F9FA,66,0,98,16382458" &cr& \
        "Gray99,251,251,251,#FBFBFB,0,0,98,16514043" &cr& \
        "Green,0,255,0,#00FF00,33,100,100,65280" &cr& \
        "Green1,95,251,23,#5FFB17,28,90,98,6290199" &cr& \
        "Green2,0,238,0,#00EE00,33,100,93,60928" &cr& \
        "Green3,0,205,0,#00CD00,33,100,80,52480" &cr& \
        "Green4,0,139,0,#008B00,33,100,54,35584" &cr& \
        "GreenYellow,173,255,47,#ADFF2F,25,81,100,11403055" &cr& \
        "Honeydew,240,254,238,#F0FEEE,33,6,99,15793902" &cr& \
        "Honeydew1,240,255,240,#F0FFF0,33,5,100,15794160" &cr& \
        "Honeydew2,222,235,220,#DEEBDC,33,6,92,14609372" &cr& \
        "Honeydew3,188,199,185,#BCC7B9,33,7,78,12371897" &cr& \
        "Honeydew4,122,125,116,#7A7D74,32,7,49,8027508" &cr& \
        "HotPink,246,96,171,#F660AB,94,60,96,16146603" &cr& \
        "HotPink1,246,101,171,#F665AB,95,58,96,16147883" &cr& \
        "HotPink2,228,94,157,#E45E9D,95,58,89,14966429" &cr& \
        "HotPink3,194,82,131,#C25283,95,57,76,12735107" &cr& \
        "HotPink4,125,34,82,#7D2252,93,72,49,8200786" &cr& \
        "IndianRed,205,92,92,#CD5C5C,0,55,80,13458524" &cr& \
        "IndianRed1,247,93,89,#F75D59,0,63,96,16211289" &cr& \
        "IndianRed2,229,84,81,#E55451,0,64,89,15029329" &cr& \
        "IndianRed3,194,70,65,#C24641,0,66,76,12731969" &cr& \
        "IndianRed4,126,34,23,#7E2217,1,81,49,8266263" &cr& \
        "Ivory,255,255,238,#FFFFEE,1,6,100,16777198" &cr& \
        "Ivory1,255,255,238,#FFFFEE,1,6,100,16777198" &cr& \
        "Ivory2,236,236,220,#ECECDC,1,6,92,15527132" &cr& \
        "Ivory3,201,199,185,#C9C7B9,1,7,78,13223865" &cr& \
        "Ivory4,129,125,116,#817D74,1,10,50,8486260" &cr& \
        "Khaki,173,169,110,#ADA96E,5,36,67,11381102" &cr& \
        "Khaki1,255,243,128,#FFF380,7,49,100,16774016" &cr& \
        "Khaki2,237,226,117,#EDE275,7,50,92,15590005" &cr& \
        "Khaki3,201,190,98,#C9BE62,7,51,78,13221474" &cr& \
        "Khaki4,130,120,57,#827839,8,56,50,8550457" &cr& \
        "Lavender,227,228,250,#E3E4FA,66,9,98,14935290" &cr& \
        "LavenderBlush,253,238,244,#FDEEF4,99,5,99,16641780" &cr& \
        "LavenderBlush1,255,240,245,#FFF0F5,99,5,100,16773365" &cr& \
        "LavenderBlush2,235,221,226,#EBDDE2,99,5,92,15457762" &cr& \
        "LavenderBlush3,200,187,190,#C8BBBE,99,6,78,13155262" &cr& \
        "LavenderBlush4,129,118,121,#817679,99,8,50,8484473" &cr& \
        "LawnGreen,124,252,0,#7CFC00,25,100,98,8190976" &cr& \
        "LemonChiffon,255,248,198,#FFF8C6,3,22,100,16775366" &cr& \
        "LemonChiffon1,255,250,205,#FFFACD,2,19,100,16775885" &cr& \
        "LemonChiffon2,238,233,191,#EEE9BF,2,19,93,15657407" &cr& \
        "LemonChiffon3,205,201,165,#CDC9A5,2,19,80,13486501" &cr& \
        "LemonChiffon4,139,137,112,#8B8970,2,19,54,9144688" &cr& \
        "LightBlue,173,216,230,#ADD8E6,63,24,90,11393254" &cr& \
        "LightBlue1,189,237,255,#BDEDFF,63,25,100,12447231" &cr& \
        "LightBlue2,175,220,236,#AFDCEC,63,25,92,11525356" &cr& \
        "LightBlue3,149,185,199,#95B9C7,63,25,78,9812423" &cr& \
        "LightBlue4,104,131,139,#68838B,63,25,54,6849419" &cr& \
        "LightCoral,231,116,113,#E77471,0,51,90,15168625" &cr& \
        "LightCyan,224,255,255,#E0FFFF,35,12,100,14745599" &cr& \
        "LightCyan1,224,255,255,#E0FFFF,35,12,100,14745599" &cr& \
        "LightCyan2,207,236,236,#CFECEC,35,12,92,13626604" &cr& \
        "LightCyan3,175,199,199,#AFC7C7,35,12,78,11519943" &cr& \
        "LightCyan4,113,125,125,#717D7D,34,9,49,7437693" &cr& \
        "LightGoldenrod,236,216,114,#ECD872,7,51,92,15521906" &cr& \
        "LightGoldenrod1,255,232,124,#FFE87C,7,51,100,16771196" &cr& \
        "LightGoldenrod2,236,214,114,#ECD672,7,51,92,15521394" &cr& \
        "LightGoldenrod3,200,181,96,#C8B560,7,52,78,13153632" &cr& \
        "LightGoldenrod4,129,115,57,#817339,7,55,50,8483641" &cr& \
        "LightGoldenrodYellow,250,248,204,#FAF8CC,2,18,98,16447692" &cr& \
        "LightGray,160,159,157,#A09F9D,0,1,62,10526621" &cr& \
        "LightGreen,144,238,144,#90EE90,33,39,93,9498256" &cr& \
        "LightPink,250,175,186,#FAAFBA,99,30,98,16428986" &cr& \
        "LightPink1,249,167,176,#F9A7B0,99,32,97,16361392" &cr& \
        "LightPink2,231,153,163,#E799A3,99,33,90,15178147" &cr& \
        "LightPink3,196,129,137,#C48189,99,34,76,12878217" &cr& \
        "LightPink4,127,78,82,#7F4E52,99,38,49,8343122" &cr& \
        "LightSalmon,249,150,107,#F9966B,2,57,97,16356971" &cr& \
        "LightSalmon1,255,160,122,#FFA07A,2,52,100,16752762" &cr& \
        "LightSalmon2,231,138,97,#E78A61,2,58,90,15174241" &cr& \
        "LightSalmon3,196,116,81,#C47451,2,58,76,12874833" &cr& \
        "LightSalmon4,127,70,44,#7F462C,3,65,49,8341036" &cr& \
        "LightSeaGreen,32,178,170,#20B2AA,46,82,69,2142890" &cr& \
        "LightSkyBlue,130,202,250,#82CAFA,61,48,98,8571642" &cr& \
        "LightSkyBlue1,173,223,255,#ADDFFF,63,32,100,11395071" &cr& \
        "LightSkyBlue2,160,207,236,#A0CFEC,63,32,92,10538988" &cr& \
        "LightSkyBlue3,135,175,199,#87AFC7,63,32,78,8892359" &cr& \
        "LightSkyBlue4,86,109,126,#566D7E,63,31,49,5664126" &cr& \
        "LightSlateBlue,115,106,255,#736AFF,67,58,100,7564031" &cr& \
        "LightSlateGray,109,123,141,#6D7B8D,65,22,55,7175053" &cr& \
        "LightSteelBlue,114,143,206,#728FCE,64,44,80,7507918" &cr& \
        "LightSteelBlue1,198,222,255,#C6DEFF,65,22,100,13033215" &cr& \
        "LightSteelBlue2,183,206,236,#B7CEEC,65,22,92,12046060" &cr& \
        "LightSteelBlue3,154,173,199,#9AADC7,65,22,78,10137031" &cr& \
        "LightSteelBlue4,100,109,126,#646D7E,65,20,49,6581630" &cr& \
        "LightYellow,255,254,220,#FFFEDC,2,13,100,16776924" &cr& \
        "LightYellow1,255,255,224,#FFFFE0,2,12,100,16777184" &cr& \
        "LightYellow2,237,235,203,#EDEBCB,2,14,92,15592395" &cr& \
        "LightYellow3,201,199,170,#C9C7AA,2,15,78,13223850" &cr& \
        "LightYellow4,130,125,107,#827D6B,2,17,50,8551787" &cr& \
        "LimeGreen,50,205,50,#32CD32,33,75,80,3329330" &cr& \
        "Linen,249,238,226,#F9EEE2,0,9,97,16379618" &cr& \
        "Magenta,244,62,255,#F43EFF,78,75,100,16006911" &cr& \
        "Magenta1,255,0,255,#FF00FF,83,100,100,16711935" &cr& \
        "Magenta2,226,56,236,#E238EC,78,76,92,14825708" &cr& \
        "Magenta3,192,49,199,#C031C7,78,75,78,12595655" &cr& \
        "Magenta4,125,27,126,#7D1B7E,79,78,49,8199038" &cr& \
        "Maroon,129,5,65,#810541,92,96,50,8455489" &cr& \
        "Maroon1,245,53,170,#F535AA,92,78,96,16070058" &cr& \
        "Maroon2,227,49,157,#E3319D,92,78,89,14889373" &cr& \
        "Maroon3,193,34,131,#C12283,91,82,75,12657283" &cr& \
        "Maroon4,125,5,82,#7D0552,89,96,49,8193362" &cr& \
        "MediumAquamarine,102,205,170,#66CDAA,38,50,80,6737322" &cr& \
        "MediumBlue,0,0,205,#0000CD,66,100,80,205" &cr& \
        "MediumForestGreen,52,114,53,#347235,33,54,44,3437109" &cr& \
        "MediumGoldenrod,204,185,84,#CCB954,8,58,80,13416788" &cr& \
        "MediumOrchid,176,72,181,#B048B5,76,60,70,11552949" &cr& \
        "MediumOrchid1,212,98,255,#D462FF,74,61,100,13918975" &cr& \
        "MediumOrchid2,196,90,236,#C45AEC,74,61,92,12868332" &cr& \
        "MediumOrchid3,167,74,199,#A74AC7,74,62,78,10963655" &cr& \
        "MediumOrchid4,106,40,126,#6A287E,75,68,49,6957182" &cr& \
        "MediumPurple,132,103,215,#8467D7,68,52,84,8677335" &cr& \
        "MediumPurple1,171,130,255,#AB82FF,69,49,100,11240191" &cr& \
        "MediumPurple2,159,121,238,#9F79EE,69,49,93,10451438" &cr& \
        "MediumPurple3,137,104,205,#8968CD,69,49,80,9005261" &cr& \
        "MediumPurple4,93,71,139,#5D478B,69,48,54,6113163" &cr& \
        "MediumSeaGreen,48,103,84,#306754,39,53,40,3172180" &cr& \
        "MediumSlateBlue,123,104,238,#7B68EE,67,56,93,8087790" &cr& \
        "MediumSpringGreen,0,250,154,#00FA9A,43,100,98,64154" &cr& \
        "MediumTurquoise,72,204,205,#48CCCD,55,64,80,4771021" &cr& \
        "MediumVioletRed,199,21,133,#C71585,90,89,78,13047173" &cr& \
        "MidnightBlue,21,27,84,#151B54,65,75,32,1383252" &cr& \
        "MintCream,245,255,249,#F5FFF9,33,3,100,16121849" &cr& \
        "MistyRose,253,225,221,#FDE1DD,0,12,99,16638429" &cr& \
        "MistyRose1,255,228,225,#FFE4E1,0,11,100,16770273" &cr& \
        "MistyRose2,234,208,204,#EAD0CC,0,12,91,15388876" &cr& \
        "MistyRose3,198,175,172,#C6AFAC,0,13,77,13021100" &cr& \
        "MistyRose4,128,111,108,#806F6C,0,15,50,8417132" &cr& \
        "Moccasin,253,224,172,#FDE0AC,3,32,99,16638124" &cr& \
        "NavajoWhite,253,218,163,#FDDAA3,3,35,99,16636579" &cr& \
        "NavajoWhite1,255,222,173,#FFDEAD,3,32,100,16768685" &cr& \
        "NavajoWhite2,234,201,149,#EAC995,3,36,91,15387029" &cr& \
        "NavajoWhite3,199,170,125,#C7AA7D,3,37,78,13085309" &cr& \
        "NavajoWhite4,128,106,75,#806A4B,4,41,50,8415819" &cr& \
        "Navy,0,0,128,#000080,66,100,50,128" &cr& \
        "NavyBlue,0,0,128,#000080,66,100,50,128" &cr& \
        "OldLace,252,243,226,#FCF3E2,1,10,98,16577506" &cr& \
        "OliveDrab,101,128,23,#658017,23,82,50,6651927" &cr& \
        "OliveDrab1,192,255,62,#C0FF3E,24,75,100,12648254" &cr& \
        "OliveDrab2,179,238,58,#B3EE3A,24,75,93,11791930" &cr& \
        "OliveDrab3,153,197,23,#99C517,22,88,77,10077463" &cr& \
        "OliveDrab4,105,139,34,#698B22,24,75,54,6916898" &cr& \
        "Orange,248,122,23,#F87A17,6,90,97,16284183" &cr& \
        "Orange1,250,155,23,#FA9B17,8,90,98,16423703" &cr& \
        "Orange2,231,142,23,#E78E17,8,90,90,15175191" &cr& \
        "Orange3,197,119,23,#C57717,8,88,77,12941079" &cr& \
        "Orange4,127,72,23,#7F4817,6,81,49,8341527" &cr& \
        "OrangeRed,246,56,23,#F63817,2,90,96,16136215" &cr& \
        "OrangeRed1,255,69,0,#FF4500,4,100,100,16729344" &cr& \
        "OrangeRed2,228,49,23,#E43117,1,89,89,14954775" &cr& \
        "OrangeRed3,194,40,23,#C22817,1,88,76,12724247" &cr& \
        "OrangeRed4,126,5,23,#7E0517,97,96,49,8258839" &cr& \
        "Orchid,218,112,214,#DA70D6,92,48,85,14315734" &cr& \
        "Orchid1,246,125,250,#F67DFA,74,50,98,16154106" &cr& \
        "Orchid2,228,115,231,#E473E7,74,50,90,14971879" &cr& \
        "Orchid3,193,96,195,#C160C3,74,50,76,12673219" &cr& \
        "Orchid4,125,56,124,#7D387C,90,55,49,8206460" &cr& \
        "PaleGoldenrod,237,228,158,#EDE49E,4,33,92,15590558" &cr& \
        "PaleGreen,121,216,103,#79D867,31,52,84,7985255" &cr& \
        "PaleGreen1,154,255,154,#9AFF9A,33,39,100,10157978" &cr& \
        "PaleGreen2,144,238,144,#90EE90,33,39,93,9498256" &cr& \
        "PaleGreen3,124,205,124,#7CCD7C,33,39,80,8179068" &cr& \
        "PaleGreen4,78,124,65,#4E7C41,31,47,48,5143617" &cr& \
        "PaleTurquoise,174,235,236,#AEEBEC,62,26,92,11463660" &cr& \
        "PaleTurquoise1,187,255,255,#BBFFFF,37,26,100,12320767" &cr& \
        "PaleTurquoise2,173,235,236,#ADEBEC,62,26,92,11398124" &cr& \
        "PaleTurquoise3,146,199,199,#92C7C7,37,26,78,9619399" &cr& \
        "PaleTurquoise4,102,139,139,#668B8B,37,26,54,6720395" &cr& \
        "PaleVioletRed,209,101,135,#D16587,97,51,81,13723015" &cr& \
        "PaleVioletRed1,247,120,161,#F778A1,97,51,96,16218273" &cr& \
        "PaleVioletRed2,229,110,148,#E56E94,97,51,89,15036052" &cr& \
        "PaleVioletRed3,194,90,124,#C25A7C,97,53,76,12737148" &cr& \
        "PaleVioletRed4,126,53,77,#7E354D,96,57,49,8271181" &cr& \
        "PapayaWhip,254,236,207,#FEECCF,1,18,99,16706767" &cr& \
        "PeachPuff,252,213,176,#FCD5B0,2,30,98,16569776" &cr& \
        "PeachPuff1,255,218,185,#FFDAB9,2,27,100,16767673" &cr& \
        "PeachPuff2,234,197,163,#EAC5A3,2,30,91,15386019" &cr& \
        "PeachPuff3,198,166,136,#C6A688,2,31,77,13018760" &cr& \
        "PeachPuff4,128,103,82,#806752,2,35,50,8415058" &cr& \
        "Peru,197,119,38,#C57726,6,80,77,12941094" &cr& \
        "Pink,250,175,190,#FAAFBE,99,30,98,16428990" &cr& \
        "Pink1,255,181,197,#FFB5C5,98,29,100,16758213" &cr& \
        "Pink2,231,161,176,#E7A1B0,98,30,90,15180208" &cr& \
        "Pink3,196,135,147,#C48793,98,31,76,12879763" &cr& \
        "Pink4,127,82,93,#7F525D,98,35,49,8344157" &cr& \
        "Plum,185,59,143,#B93B8F,92,68,72,12139407" &cr& \
        "Plum1,249,183,255,#F9B7FF,70,28,100,16365567" &cr& \
        "Plum2,230,169,236,#E6A9EC,70,28,92,15116780" &cr& \
        "Plum3,195,142,199,#C38EC7,71,28,78,12816071" &cr& \
        "Plum4,126,88,126,#7E587E,94,30,49,8280190" &cr& \
        "PowderBlue,173,220,227,#ADDCE3,63,23,89,11394275" &cr& \
        "Purple,142,53,239,#8E35EF,72,77,93,9319919" &cr& \
        "Purple1,137,59,255,#893BFF,71,76,100,8993791" &cr& \
        "Purple2,127,56,236,#7F38EC,71,76,92,8337644" &cr& \
        "Purple3,108,45,199,#6C2DC7,71,77,78,7089607" &cr& \
        "Purple4,70,27,126,#461B7E,72,78,49,4594558" &cr& \
        "Red,255,0,0,#FF0000,0,100,100,16711680" &cr& \
        "Red1,246,34,23,#F62217,0,90,96,16130583" &cr& \
        "Red2,228,27,23,#E41B17,0,89,89,14949143" &cr& \
        "Red3,193,27,23,#C11B17,0,88,75,12655383" &cr& \
        "Red4,126,5,23,#7E0517,97,96,49,8258839" &cr& \
        "RosyBrown,179,132,129,#B38481,0,27,70,11764865" &cr& \
        "RosyBrown1,251,187,185,#FBBBB9,0,26,98,16497593" &cr& \
        "RosyBrown2,232,173,170,#E8ADAA,0,26,90,15248810" &cr& \
        "RosyBrown3,197,144,142,#C5908E,0,27,77,12947598" &cr& \
        "RosyBrown4,127,90,88,#7F5A58,0,30,49,8346200" &cr& \
        "RoyalBlue,43,96,222,#2B60DE,62,80,87,2842846" &cr& \
        "RoyalBlue1,48,110,255,#306EFF,62,81,100,3174143" &cr& \
        "RoyalBlue2,43,101,236,#2B65EC,62,81,92,2844140" &cr& \
        "RoyalBlue3,37,84,199,#2554C7,62,81,78,2446535" &cr& \
        "RoyalBlue4,21,49,126,#15317E,62,83,49,1388926" &cr& \
        "SaddleBrown,126,49,23,#7E3117,3,81,49,8270103" &cr& \
        "Salmon,225,139,107,#E18B6B,2,52,88,14781291" &cr& \
        "Salmon1,248,129,88,#F88158,2,64,97,16286040" &cr& \
        "Salmon2,230,116,81,#E67451,2,64,90,15103057" &cr& \
        "Salmon3,195,98,65,#C36241,2,66,76,12804673" &cr& \
        "Salmon4,126,56,23,#7E3817,4,81,49,8271895" &cr& \
        "SandyBrown,238,154,77,#EE9A4D,5,67,93,15637069" &cr& \
        "SeaGreen,46,139,87,#2E8B57,38,66,54,3050327" &cr& \
        "SeaGreen1,106,251,146,#6AFB92,35,57,98,7011218" &cr& \
        "SeaGreen2,100,233,134,#64E986,35,57,91,6613382" &cr& \
        "SeaGreen3,67,205,128,#43CD80,38,67,80,4443520" &cr& \
        "SeaGreen4,46,139,87,#2E8B57,38,66,54,3050327" &cr& \
        "Seashell,254,243,235,#FEF3EB,0,7,99,16708587" &cr& \
        "Seashell1,255,245,238,#FFF5EE,0,6,100,16774638" &cr& \
        "Seashell2,238,229,222,#EEE5DE,0,6,93,15656414" &cr& \
        "Seashell3,205,197,191,#CDC5BF,0,6,80,13485503" &cr& \
        "Seashell4,139,134,130,#8B8682,0,6,54,9143938" &cr& \
        "Sienna,160,82,45,#A0522D,3,71,62,10506797" &cr& \
        "Sienna1,248,116,49,#F87431,4,80,97,16282673" &cr& \
        "Sienna2,230,108,44,#E66C2C,4,80,90,15100972" &cr& \
        "Sienna3,195,88,23,#C35817,5,88,76,12802071" &cr& \
        "Sienna4,126,53,23,#7E3517,3,81,49,8271127" &cr& \
        "SkyBlue,102,152,255,#6698FF,63,60,100,6723839" &cr& \
        "SkyBlue1,130,202,255,#82CAFF,61,49,100,8571647" &cr& \
        "SkyBlue2,121,186,236,#79BAEC,62,48,92,7977708" &cr& \
        "SkyBlue3,101,158,199,#659EC7,61,49,78,6659783" &cr& \
        "SkyBlue4,65,98,126,#41627E,62,48,49,4285054" &cr& \
        "SlateBlue,106,90,205,#6A5ACD,67,56,80,6970061" &cr& \
        "SlateBlue1,115,105,255,#7369FF,67,58,100,7563775" &cr& \
        "SlateBlue2,105,96,236,#6960EC,67,59,92,6906092" &cr& \
        "SlateBlue3,105,89,205,#6959CD,67,56,80,6904269" &cr& \
        "SlateBlue4,52,45,126,#342D7E,67,64,49,3419518" &cr& \
        "SlateGray,101,115,131,#657383,64,22,51,6648707" &cr& \
        "SlateGray1,194,223,255,#C2DFFF,64,23,100,12771327" &cr& \
        "SlateGray2,180,207,236,#B4CFEC,64,23,92,11849708" &cr& \
        "SlateGray3,152,175,199,#98AFC7,64,23,78,10006471" &cr& \
        "SlateGray4,108,123,139,#6C7B8B,64,22,54,7109515" &cr& \
        "Snow,255,249,250,#FFF9FA,99,2,100,16775674" &cr& \
        "Snow1,255,250,250,#FFFAFA,0,1,100,16775930" &cr& \
        "Snow2,236,231,230,#ECE7E6,0,2,92,15525862" &cr& \
        "Snow3,200,196,194,#C8C4C2,0,3,78,13157570" &cr& \
        "Snow4,129,124,123,#817C7B,0,4,50,8486011" &cr& \
        "SpringGreen,0,255,127,#00FF7F,41,100,100,65407" &cr& \
        "SpringGreen1,94,251,110,#5EFB6E,34,62,98,6224750" &cr& \
        "SpringGreen2,0,238,118,#00EE76,41,100,93,61046" &cr& \
        "SpringGreen3,0,205,102,#00CD66,41,100,80,52582" &cr& \
        "SpringGreen4,0,139,69,#008B45,41,100,54,35653" &cr& \
        "SteelBlue,70,130,180,#4682B4,61,61,70,4620980" &cr& \
        "SteelBlue1,92,179,255,#5CB3FF,60,63,100,6075391" &cr& \
        "SteelBlue2,86,165,236,#56A5EC,61,63,92,5678572" &cr& \
        "SteelBlue3,72,138,199,#488AC7,61,63,78,4754119" &cr& \
        "SteelBlue4,43,84,126,#2B547E,61,65,49,2839678" &cr& \
        "Tan,210,180,140,#D2B48C,3,33,82,13808780" &cr& \
        "Tan1,250,155,60,#FA9B3C,6,76,98,16423740" &cr& \
        "Tan2,231,142,53,#E78E35,6,77,90,15175221" &cr& \
        "Tan3,197,119,38,#C57726,6,80,77,12941094" &cr& \
        "Tan4,127,72,23,#7F4817,6,81,49,8341527" &cr& \
        "Thistle,210,185,211,#D2B9D3,68,12,82,13810131" &cr& \
        "Thistle1,252,223,255,#FCDFFF,68,12,100,16572415" &cr& \
        "Thistle2,233,207,236,#E9CFEC,68,12,92,15323116" &cr& \
        "Thistle3,198,174,199,#C6AEC7,68,12,78,13020871" &cr& \
        "Thistle4,128,109,126,#806D7E,97,14,50,8416638" &cr& \
        "Tomato,247,84,49,#F75431,2,80,96,16208945" &cr& \
        "Tomato1,255,99,71,#FF6347,1,72,100,16737095" &cr& \
        "Tomato2,229,76,44,#E54C2C,2,80,89,15027244" &cr& \
        "Tomato3,194,62,23,#C23E17,3,88,76,12729879" &cr& \
        "Tomato4,126,34,23,#7E2217,1,81,49,8266263" &cr& \
        "Transparent,21,5,23,#150517,78,78,9,1377559" &cr& \
        "Turquoise,64,224,208,#40E0D0,44,71,87,4251856" &cr& \
        "Turquoise1,0,245,255,#00F5FF,50,100,100,62975" &cr& \
        "Turquoise2,0,229,238,#00E5EE,50,100,93,58862" &cr& \
        "Turquoise3,0,197,205,#00C5CD,50,100,80,50637" &cr& \
        "Turquoise4,0,134,139,#00868B,50,100,54,34443" &cr& \
        "Violet,141,56,201,#8D38C9,73,72,78,9255113" &cr& \
        "VioletRed,208,32,144,#D02090,91,84,81,13639824" &cr& \
        "VioletRed1,246,53,138,#F6358A,94,78,96,16135562" &cr& \
        "VioletRed2,228,49,127,#E4317F,94,78,89,14954879" &cr& \
        "VioletRed3,193,40,105,#C12869,94,79,75,12658793" &cr& \
        "VioletRed4,125,5,65,#7D0541,92,96,49,8193345" &cr& \
        "Wheat,243,218,169,#F3DAA9,3,30,95,15981225" &cr& \
        "Wheat1,254,228,177,#FEE4B1,3,30,99,16704689" &cr& \
        "Wheat2,235,211,163,#EBD3A3,3,30,92,15455139" &cr& \
        "Wheat3,200,177,137,#C8B189,3,31,78,13152649" &cr& \
        "Wheat4,129,111,84,#816F54,3,34,50,8482644" &cr& \
        "White,255,255,255,#FFFFFF,0,0,100,16777215" &cr& \
        "WhiteSmoke,244,244,243,#F4F4F3,0,0,95,16053491" &cr& \
        "Yellow,255,255,0,#FFFF00,16,100,100,16776960" &cr& \
        "Yellow1,255,255,0,#FFFF00,16,100,100,16776960" &cr& \
        "Yellow2,238,233,23,#EEE917,14,90,93,15657239" &cr& \
        "Yellow3,202,197,23,#CAC517,14,88,79,13288727" &cr& \
        "Yellow4,130,124,23,#827C17,12,82,50,8551447" &cr& \
        "YellowGreen,154,205,50,#9ACD32,24,75,80,10145074"
end hhColorNamesInfo
shiftLock happens

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2588
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: ColorName to RGB function

Post by mwieder » Thu Dec 17, 2015 9:37 pm

In the LC8 IDE, look in the Toolset/resources/supporting_files/colors folder. There are two text files there that do the conversions.

In previous versions without those files the conversion is built into the engine, so conversion at the script level is ugly.
In earlier versions of the IDE, the list of colors is in the "Color Names" field of the Toolset/palettes/revcolorchooser.rev stack. The code in the revcolorchooser stack to return the numeric value is

Code: Select all

    get the effective backPixel of button cindex
    set the backColor of button cindex to empty
    set the backPixel of button cindex to it
    return the effective backColor of button cindex
where cindex is the short name of the button selected.

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1553
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: ColorName to RGB function

Post by [-hh] » Thu Dec 17, 2015 10:33 pm

@Mark W.
Because I am still more a beginning than advanced user I read your post three times but still can't figure out what you are saying.
Please tell me, what is in the two files namesToColors and colorsToNames of LC 8 that is not in my single function?
They are even less informative, because there are different names for the same color and colorsToNames returns only one hit per color.

Hermann

p.s. I made this list, by the way, in 2013, my first year with LC based on the technique you describe (I didn't use a button). We had then a discussion in the forum about funny 'shades of gray', for example gray1 = gray17 = Transparent. These zombie X11 values are still in the namesToColors LC 8 list and in colorsToNames is 21,5,3 mapped to Transparent only ...
shiftLock happens

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2588
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: ColorName to RGB function

Post by mwieder » Thu Dec 17, 2015 11:29 pm

Hermann-

Your function does exactly what it should. I was just pointing out that the conversion tables are already in text files in LC8, so it wasn't necessary to repeat them. I'm certainly *not* condoning the way the IDE does this in previous builds, just pointing out that it's done that way. If I had to do a name-to-color conversion in a pre-LC8 stack I would probably use your function and filter the result.

And you're correct that there are multiple text names for the same color: Gray11 through Gray17, for instance, are the same RGB value. But I don't see how this is a problem in finding the RGB value of color "Gray13". If you go the other way around it gets weird.

NB: I have never considered you a "beginning" user. <g>

pderks
Posts: 39
Joined: Sat May 14, 2011 4:25 pm
Location: Krefeld • Deutschland

Re: ColorName to RGB function

Post by pderks » Sun Oct 02, 2016 12:35 am

@ mwieder » Thu Dec 17, 2015 9:37 pm

In LiveCode 8.1.0 the cited lists are incorrect:
• they contain 555 lines instead of 552 lines of the ColorNames function.
• some lines are duplicates.
• "gray9" until "gray17" have the same values.

In LC 8.1.0 some gray colors like "Gray3,Gray4,Gray5,Gray6,Gray7,Gray8,…" don't seem to exist.
The message command "set the backgroundColor of btn 1 to "Gray3"" results in:
"Message execution error:
Error description: penColor: bad color
Hint: "

Regards

Peter

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2588
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: ColorName to RGB function

Post by mwieder » Sun Oct 02, 2016 2:24 am

Peter-

Ick! Good catch. Yes, there was a pull request to fix the GrayXX colors in the engine itself (https://github.com/livecode/livecode/pull/4290), but that didn't correct them in the supporting file.

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1553
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: ColorName to RGB function

Post by [-hh] » Sun Oct 02, 2016 8:20 am

Hi all,

There is a great "chaos" all around the web what grayX (or grey X) is. Meant was always with that to use X as a percentage of 255. So (invisible) differences come from using round() or trunc() or ceil().

That's why, TMHO, it may be better not to use any greyX (or grayX) name, but a function that returns exactly what you want. For example, this works for me:

Code: Select all

-- pPercent is an integer between 0 an 100
function greyColor pPercent
  put trunc(pPercent*255/100) into cc
  return (cc,cc,cc)
end greyColor

function grayColor pPercent
  return greyColor pPercent
end grayColor
shiftLock happens

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2588
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: ColorName to RGB function

Post by mwieder » Sun Oct 02, 2016 5:00 pm

Yes, thanks. That's exactly the algorithm I have proposed for the GrayX color conversions, but at the moment even the hard-coded RGB values in the lookup table aren't consistently working. I am at present trying to understand the current lookup mechanism with an eye to how to fix it.

Post Reply

Return to “Feature Requests”