Class SwatchPalette
java.lang.Object
com.iizigo.prop.editor.color.swt.SwatchPalette
The generated palette of the Swatches tab (CC-COLOR-CHOOSER-SWT-PANELS, 2026-10-10): the same palette the Swing swatch panel of CC-FIX-COLOR-CHOOSER generated, computed from the HSV model rather than from a table, so that it is a pure function of the cell.
31 columns by 9 rows. Column 0 is a gray ramp from white (row 0) to black (row 8). Columns 1 to 30 are the hues at 12 degree steps; rows 0 to 3 are tints (saturation 0.2, 0.4, 0.6, 0.8 at full value), row 4 the pure hue, rows 5 to 8 shades (full saturation, value 0.82, 0.64, 0.46, 0.28).
- Author:
- Christopher Mindus
Field Summary
FieldsMethod Summary
Field Details
COLUMNS
public static final int COLUMNSThe columns: one gray ramp and 30 hues.- See Also:
ROWS
public static final int ROWSThe rows: four tints, the pure color, four shades.- See Also:
HUES
public static final int HUESThe number of hues.- See Also:
Method Details
colorAt
public static int colorAt(int column, int row) Gets a color of the palette as a pure function of its cell.- Parameters:
column- 0 toCOLUMNS-1.row- 0 toROWS-1.- Returns:
- The opaque color.
- Throws:
IndexOutOfBoundsException- For a cell outside the palette.
colors
public static int[] colors()Gets the palette, row by row (index=row*COLUMNS+column), built once. The array is shared: do not write into it.colorAt
public static int colorAt(int index) Gets a color of the palette by its row-major index.- Parameters:
index-0toCOLUMNS*ROWS-1.