The Safety Palette


For reference, this section quickly mentions the safety palette, which is a very commonly used default palette. The way it works is that you set six equally spaced possible values for each color component: 0, 51, 102, 153, 204, and 255. In other words, the red component can have any of these values. So can the green component. So can the blue component. Possible colors from the safety palette include (0,0,0), black; (153,0,0), a fairly dark shade of red; (0, 255,102), green with a smattering of blue added; and so on. This gives you a total of 6 cubed = 216 colors. The idea is that this gives you an easy way of having a palette that contains colors from right across the spectrum and of all degrees of brightness, although in practice this doesn’t actually work that well because equal mathematical spacing of color components doesn’t mean equal perception of color differences by the human eye.

If you set Windows to 256-color mode, you’ll find the default palette you get is the safety palette, with 20 Windows-standard colors added to it, and 20 spare colors.




Professional C# 2005 with .NET 3.0
Professional C# 2005 with .NET 3.0
ISBN: 470124725
EAN: N/A
Year: 2007
Pages: 427

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net