tags:

views:

100

answers:

3

The Colors class exposes too complicated properties (i.e. beige and other column I don't need).

I only want a list of the main colors, or at least the list should be ordered by extremeness, i.e. should first contain the explicit colors like black, white, red, green, blue, then should go to more complex combinations like yello, orange, purple, etc.

Update

Related: Generate a specific color for each string?

A: 

I don't think there is any agreed-upon definition of what are "main" colors, if you want a collection of only certain colors you will have to define them yourself. Also, the .Net Colors are not ordered, so you will have to create your own ordered collection to get certain colors "before" others.

Dour High Arch
+1  A: 

There's actually a few 256 color configurations.

I can't think of any .NET libraries that contain these colors; you'll probably either have to generate the colors yourself or parse these pages using some tricky copy/paste and search/replace to hard code them.

The VGA palette is sort of the one that's the most "native" to the PC industry:

http://en.wikipedia.org/wiki/VGA#The_VGA_color_palette

You can also programmatically generate an 8 bit truecolor palette:

http://en.wikipedia.org/wiki/8-bit_color

The 216 color web palette might also suit your needs:

http://www.pagetutor.com/common/bgcolors216.html

http://en.wikipedia.org/wiki/Web_colors#Web-safe_colors

Edit: Color extremeness is sort of a dark art actually, perceptual color extremeness doubly so.

You might come up with a scheme to sample the HSB chart at the correct intervals, but extremity is a one-dimensional concept, and HSB is a three-dimensional chart... so I'm not too sure how you'd do it.

Rei Miyasaka
You didn't notice that I tagged my question WPF. anyway, I updated it, please read the related question and understand why I was asking this one.
Shimmy
Well, if there arent' any libraries for .NET, there aren't any for WPF -- if that's what you mean. You're probably going to have to parse one of these charts regardless. I'll make a post on your other thread about how you might sort the colors, one sec...
Rei Miyasaka
A: 

The html "safe" colors are to set RGB values each to 0x00, 0x33, 0x66, 0x99, 0xCC, 0xFF . This only sucks up 216 colors, the other 40 being reserved for "system" colors. This is highly irrelevant today, but is usually what people used to think of as the main 256 colors as far as the web was concerned. See for example W3Schools Html Colors. Note that the css colorlist suggested by W3 Schools is not made up of "safe" colors.

Brian