Andy Fitzsimon wrote:
... Here's what i recommend:
Kill: gray, blues, gold, green, reds, royal. hilte, topographic, khaki, and inkscape-default (its a bad default)
Keep, tango, echo, ubuntu, XP, latex, websafe22, webhex
Add: Android palette (below) and fedora's echo palette
I think it would make sense to also keep the SVG palette (although I do have my doubts about the order in which the colors are presented).
In light of Johan's comment about inkscape's default palette and my own experience (I tend to use it a lot as well, but also mostly the first part, but I do miss a few hues and such) I have created a palette (see attachments) that is more or less the same as the first 26 colors of the original Inkscape default, except that: - It has more choice of hues (it used to only have hues exactly in between two primary colors, and it now also has the colors at one quarter and three quarters). - In addition to showing a darker variant of each color it also shows a lighter color. - It does not contain the 2.5%, 5% and 7.5% grays. This gives a total of 47 colors, which means doesn't scroll even on 1024x768 (windows xp). If necessary for some reason the three extra grays can be added (for a total of 50 colors), still without scrolling.
GIMP Palette Name: Test # generated by PaletteGen.py 0 0 0 Black 26 26 26 90% Gray 51 51 51 80% Gray 76 76 76 70% Gray 102 102 102 60% Gray 128 128 128 50% Gray 153 153 153 40% Gray 178 178 178 30% Gray 204 204 204 20% Gray 230 230 230 10% Gray 255 255 255 White 128 0 0 Maroon (#800000) 255 0 0 Red (#FF0000) 255 128 128 #FF8080 128 64 0 #804000 255 128 0 #FF8000 255 191 128 #FFBF80 128 128 0 Olive (#808000) 255 255 0 Yellow (#FFFF00) 255 255 128 #FFFF80 64 128 0 #408000 127 255 0 Chartreuse (#7FFF00) 191 255 128 #BFFF80 0 128 0 Green (#008000) 0 255 0 Lime (#00FF00) 128 255 128 #80FF80 0 128 64 #008040 0 255 127 Spring green (#00FF7F) 128 255 191 #80FFBF 0 128 128 Teal (#008080) 0 255 255 Aqua (#00FFFF) 128 255 255 #80FFFF 0 64 128 #004080 0 128 255 #0080FF 128 191 255 #80BFFF 0 0 128 Navy (#000080) 0 0 255 Blue (#0000FF) 128 128 255 #8080FF 64 0 128 #400080 128 0 255 #8000FF 191 128 255 #BF80FF 128 0 128 Purple (#800080) 255 0 255 Fuchsia (#FF00FF) 255 128 255 #FF80FF 128 0 64 #800040 255 0 128 #FF0080 255 128 191 #FF80BF
# This method is more consistent than colorsys.hls_to_rgb # Specifically, hls_to_rgb sometimes returns a value that is rounded # to 0x7F and sometimes a value that is rounded to 0x80 when it should # output 0.5*255=127.5. def rgbFromHSL(H,S=None,L=None): if S is None and L is None and type(H) is tuple: H,S,L = H C = 2.0*L*S if L<=0.5 else (2.0-2.0*L)*S H1 = (float(H)%1.0)*6.0 X = C*(1-abs(H1 % 2 - 1)) if 0<=H1<1: c1 = (C,X,0) elif 1<=H1<2: c1 = (X,C,0) elif 2<=H1<3: c1 = (0,C,X) elif 3<=H1<4: c1 = (0,X,C) elif 4<=H1<5: c1 = (X,0,C) elif 5<=H1<6: c1 = (C,0,X) m = L - C/2.0 return tuple(map(lambda c:c+m,c1))
# Initialization Ngrays = 10+1 # In increments of 10% Nhues = 4 # The number of hues "per side" colors = []
# Gray values for i in range(0,Ngrays): colors.append(rgbFromHSL(0.0,0.0,i/(Ngrays-1.0)))
# Hues (S=1, L=0.25,0.5,0.75) for i in range(0,3*Nhues): for L in (0.25,0.5,0.75): colors.append(rgbFromHSL(i/(3.0*Nhues),1.0,L))
# Print colors print """GIMP Palette Name: Test # generated by PaletteGen.py""" knownColors = [ # HTML colors ((128,0,0),"Maroon"), ((255,0,0),"Red"), ((128,128,0),"Olive"), ((255,255,0),"Yellow"), ((0,128,0),"Green"), ((0,255,0),"Lime"), ((0,128,128),"Teal"), ((0,255,255),"Aqua"), ((0,0,128),"Navy"), ((0,0,255),"Blue"), ((128,0,128),"Purple"), ((255,0,255),"Fuchsia"), # SVG colors (capitalized and spaced when actually used in the result) ((0,0,0),"black"), ((105,105,105),"dimgray"), ((128,128,128),"gray"), ((169,169,169),"darkgray"), ((192,192,192),"silver"), ((211,211,211),"lightgray"), ((220,220,220),"gainsboro"), ((245,245,245),"whitesmoke"), ((255,255,255),"white"), ((188,143,143),"rosybrown"), ((205,92,92),"indianred"), ((165,42,42),"brown"), ((178,34,34),"firebrick"), ((240,128,128),"lightcoral"), ((128,0,0),"maroon"), ((139,0,0),"darkred"), ((255,0,0),"red"), ((255,250,250),"snow"), ((255,228,225),"mistyrose"), ((250,128,114),"salmon"), ((255,99,71),"tomato"), ((233,150,122),"darksalmon"), ((255,127,80),"coral"), ((255,69,0),"orangered"), ((255,160,122),"lightsalmon"), ((160,82,45),"sienna"), ((255,245,238),"seashell"), ((210,105,30),"chocolate"), ((139,69,19),"saddlebrown"), ((244,164,96),"sandybrown"), ((255,218,185),"peachpuff"), ((205,133,63),"peru"), ((250,240,230),"linen"), ((255,228,196),"bisque"), ((255,140,0),"darkorange"), ((222,184,135),"burlywood"), ((210,180,140),"tan"), ((250,235,215),"antiquewhite"), ((255,222,173),"navajowhite"), ((255,235,205),"blanchedalmond"), ((255,239,213),"papayawhip"), ((255,228,181),"moccasin"), ((255,165,0),"orange"), ((245,222,179),"wheat"), ((253,245,230),"oldlace"), ((255,250,240),"floralwhite"), ((184,134,11),"darkgoldenrod"), ((218,165,32),"goldenrod"), ((255,248,220),"cornsilk"), ((255,215,0),"gold"), ((240,230,140),"khaki"), ((255,250,205),"lemonchiffon"), ((238,232,170),"palegoldenrod"), ((189,183,107),"darkkhaki"), ((245,245,220),"beige"), ((250,250,210),"lightgoldenrodyellow"), ((128,128,0),"olive"), ((255,255,0),"yellow"), ((255,255,224),"lightyellow"), ((255,255,240),"ivory"), ((107,142,35),"olivedrab"), ((154,205,50),"yellowgreen"), ((85,107,47),"darkolivegreen"), ((173,255,47),"greenyellow"), ((127,255,0),"Chartreuse"), ((124,252,0),"lawngreen"), ((143,188,143),"darkseagreen"), ((34,139,34),"forestgreen"), ((50,205,50),"limegreen"), ((144,238,144),"lightgreen"), ((152,251,152),"palegreen"), ((0,100,0),"darkgreen"), ((0,128,0),"green"), ((0,255,0),"lime"), ((240,255,240),"honeydew"), ((46,139,87),"seagreen"), ((60,179,113),"mediumseagreen"), ((0,255,127),"Spring green"), ((245,255,250),"mintcream"), ((0,250,154),"mediumspringgreen"), ((102,205,170),"mediumaquamarine"), ((127,255,212),"aquamarine"), ((64,224,208),"turquoise"), ((32,178,170),"lightseagreen"), ((72,209,204),"mediumturquoise"), ((47,79,79),"darkslategray"), ((175,238,238),"paleturquoise"), ((0,128,128),"teal"), ((0,139,139),"darkcyan"), ((0,255,255),"cyan"), ((224,255,255),"lightcyan"), ((240,255,255),"azure"), ((0,206,209),"darkturquoise"), ((95,158,160),"cadetblue"), ((176,224,230),"powderblue"), ((173,216,230),"lightblue"), ((0,191,255),"deepskyblue"), ((135,206,235),"skyblue"), ((135,206,250),"lightskyblue"), ((70,130,180),"steelblue"), ((240,248,255),"aliceblue"), ((30,144,255),"dodgerblue"), ((112,128,144),"slategray"), ((119,136,153),"lightslategray"), ((176,196,222),"lightsteelblue"), ((100,149,237),"cornflowerblue"), ((65,105,225),"royalblue"), ((25,25,112),"midnightblue"), ((230,230,250),"lavender"), ((0,0,128),"navy"), ((0,0,139),"darkblue"), ((0,0,205),"mediumblue"), ((0,0,255),"blue"), ((248,248,255),"ghostwhite"), ((106,90,205),"slateblue"), ((72,61,139),"darkslateblue"), ((123,104,238),"mediumslateblue"), ((147,112,219),"mediumpurple"), ((138,43,226),"blueviolet"), ((75,0,130),"indigo"), ((153,50,204),"darkorchid"), ((148,0,211),"darkviolet"), ((186,85,211),"mediumorchid"), ((216,191,216),"thistle"), ((221,160,221),"plum"), ((238,130,238),"violet"), ((128,0,128),"purple"), ((139,0,139),"darkmagenta"), ((255,0,255),"magenta"), ((218,112,214),"orchid"), ((199,21,133),"mediumvioletred"), ((255,20,147),"deeppink"), ((255,105,180),"hotpink"), ((255,240,245),"lavenderblush"), ((219,112,147),"palevioletred"), ((220,20,60),"crimson"), ((255,192,203),"pink"), ((255,182,193),"lightpink"), ] eps = 1.5/255.0 # Use a relatively wide margin when "snapping" to colors for c in colors: ci = None name = None if max(c)-min(c)<eps: # Gray value if c[0]<eps: ci = (0,0,0) name = "Black" elif c[0]>1-eps: ci = (255,255,255) name = "White" else: ci = 3*(round(sum(c)*(255.0/3)),) name = "%u%% Gray" % round(100.0-sum(c)*(100.0/3)) else: for kc,kn in knownColors: diff = (abs(kc[0]-255*c[0]),abs(kc[1]-255*c[1]),abs(kc[2]-255*c[2])) if max(diff)<255*eps: ci = kc name = kn + (" (#%02X%02X%02X)" % ci) break if ci is None: ci = tuple(map(lambda v:round(255*v), c)) name = "#%02X%02X%02X" % ci print "%3u %3u %3u %s" % (ci+(name,))