public abstract class ColorSet extends Object
This is a 2D image of colors.
Here are possible customizations the PALETTE_CELL_STYLE_PROPERTY and PALETTE_STYLE_PROPERTY allow:
| Default Cell | Shadow Cell | Scribble Cell | |
| Default Palette | ![]() |
![]() |
![]() |
| Gradient Palette | ![]() |
![]() |
![]() |
| Streaks Palette | ![]() |
![]() |
![]() |
com.bric.pixel.image.quantize.ColorSet
| Modifier and Type | Field and Description |
|---|---|
static String |
PALETTE_CELL_STYLE_DEFAULT
A possible palette cell style value.
|
static String |
PALETTE_CELL_STYLE_PROPERTY
The client property name that maps to one of the PALETTE_CELL_STYLE constants.
|
static String |
PALETTE_CELL_STYLE_SCRIBBLE
A possible palette cell style value.
|
static String |
PALETTE_CELL_STYLE_SHADOW
A possible palette cell style value.
|
static String |
PALETTE_STYLE_DEFAULT
A possible palette style value.
|
static String |
PALETTE_STYLE_GRADIENT
A possible palette style value.
|
static String |
PALETTE_STYLE_PROPERTY
The client property name that maps to one of the PALETTE_STYLE constants.
|
static String |
PALETTE_STYLE_STREAKS
A possible palette style value.
|
| Constructor and Description |
|---|
ColorSet(boolean grid)
Create a 10x15 color grid.
|
ColorSet(boolean grid, int rows, int columns)
|
| Modifier and Type | Method and Description |
|---|---|
void |
flush()
|
protected abstract float |
getHighlightAlpha()
|
BufferedImage |
getImage(int w, int h, JComponent
|
Point |
getPoint(int rgb, int width, int height)
|
abstract Point2D |
getRelativePoint(int rgb)
|
abstract int |
getRGB(float xFraction, float yFraction)
|
protected void |
paint(BufferedImage
|
void |
paint(BufferedImage
|
protected void |
paintGrid(BufferedImage
|
protected void |
paintGridScribbleHighlights(BufferedImage
|
protected void |
paintGridShadowHighlights(BufferedImage
|
protected void |
paintGridWithVerticalGradients(BufferedImage
|
BufferedImage |
paintSample(Dimension
Render a simple sample of this ColorSet.
|
protected void |
paintStylized(BufferedImage
|
protected void |
paintStylizedGrid(BufferedImage
|
public static final StringPALETTE_STYLE_STREAKS

PALETTE_STYLE_PROPERTY,
Constant Field Values
public static final StringPALETTE_STYLE_GRADIENT

PALETTE_STYLE_PROPERTY,
Constant Field Values
public static final StringPALETTE_STYLE_DEFAULT

PALETTE_STYLE_PROPERTY,
Constant Field Values
public static final StringPALETTE_CELL_STYLE_SHADOW

PALETTE_CELL_STYLE_PROPERTY,
Constant Field Values
public static final StringPALETTE_CELL_STYLE_SCRIBBLE

PALETTE_CELL_STYLE_PROPERTY,
Constant Field Values
public static final StringPALETTE_CELL_STYLE_DEFAULT

PALETTE_CELL_STYLE_PROPERTY,
Constant Field Values
public static final StringPALETTE_STYLE_PROPERTY
public static final StringPALETTE_CELL_STYLE_PROPERTY
public ColorSet(boolean grid)
grid - whether this is rendered with a grid or not.
public ColorSet(boolean grid,
int rows,
int columns)public BufferedImagepaintSample(Dimension size, boolean applyBorder)
size - the dimensions of the image to paint
applyBorder - whether a simple border should be applied to the new image
public void flush()
public BufferedImagegetImage(int w, int h, JComponent jc)
public void paint(BufferedImagebi, String style, String cellStyle)
bi -
style - the palette style. This should be one of the PALETTE_STYLE constants, and when defined by a JComponent: it should be the value of the PALETTE_STYLE_PROPERTY key.
cellStyle - the palette cell style. This should be one of the PALETTE_CELL_STYLE constants, and when defined by a JComponent: it should be the value of the PALETTE_CELL_STYLE_PROPERTY key.
protected void paint(BufferedImagebi)
protected void paintGridWithVerticalGradients(BufferedImagebi)
protected void paintGrid(BufferedImagebi)
protected void paintGridShadowHighlights(BufferedImagebi)
protected void paintGridScribbleHighlights(BufferedImagebi)
protected void paintStylizedGrid(BufferedImagebi)
protected void paintStylized(BufferedImagebi)
public abstract int getRGB(float xFraction,
float yFraction)public abstract Point2DgetRelativePoint(int rgb)
public PointgetPoint(int rgb, int width, int height)
protected abstract float getHighlightAlpha()