Gif safe Color chooser
Is there a java library to choose Gif safe colors or can we do this by making a cus开发者_如何学Gotom colorchooser in java itself ? If so how can it be done ?
The algorithm to generate the 63 = 216 "browser safe" colors may be found here. You can use the algorithm to implement a Custom Chooser Panel by overriding the abstract methods of AbstractColorChooserPanel
.
GIF safe colors are set of 216 colors with 8 bits for each one RGB, we can use java.awt.Color for this and use or restrict values for RGB as (hexadecimal values 00, 33, 66, 99, CC, and FF or the equivalent decimal values 0, 51, 102, 153, 204, and 255).
If you want user to select colour from UI but only 'GIF safe colors' you can use javax.swing.JColorChooser, here is how it works http://download.oracle.com/javase/tutorial/uiswing/components/colorchooser.html
I think you can use ColorPicker
精彩评论