|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectunlekker.util.ColorUtil
unlekker.util.ColorPalette
public class ColorPalette
Utility to generate color palettes.
Field Summary | |
---|---|
int |
alloc
|
int[] |
c
|
static float[] |
hsb
|
int |
num
|
int |
numSet
|
Constructor Summary | |
---|---|
ColorPalette()
|
Method Summary | |
---|---|
void |
add(float r,
float g,
float b)
Add a single color entry |
void |
add(float r,
float g,
float b,
float a)
Add a single color entry |
void |
add(int col)
Add a single color entry |
void |
add(int col,
int numcol)
Add a single color multiple times |
void |
add(java.lang.String hex)
Add a single color entry from a hexadecimal color string. |
void |
add(java.lang.String hex,
int num)
Add a single color multiple times from a hexadecimal color string. |
void |
addRange(float numrange,
float r,
float g,
float b,
float r2,
float g2,
float b2)
Adds an interpolated range of colors. |
void |
addRange(float numrange,
float r,
float g,
float b,
float a,
float r2,
float g2,
float b2,
float a2)
Adds an interpolated range of colors with alpha. |
void |
addRange(float numrange,
int c1,
int c2)
Adds an interpolated range of colors. |
void |
addRange(float numrange,
java.lang.String hex1,
java.lang.String hex2)
Adds an interpolated range of colors. |
void |
addSet(ColorSet _set)
Adds ColorSet to the palette. |
void |
empty()
Remove any color definitions. |
void |
getPalette()
Initializes palette using a randomly selected ColorSet. |
int |
getRandomCol()
Get random color from the current palette. |
void |
savePalette(java.lang.String filename)
|
void |
scramblePalette()
Scramble current palette so that colors are in random order. |
Methods inherited from class unlekker.util.ColorUtil |
---|
color, color, color, color, color, colorAdjust, colorBlended, colorBlended, colorBlended, colorMult, colorToHex, colorToHex, colorToString, getAlpha, getBrightness, getSaturation, isWhite, setAlpha |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int num
public int alloc
public int numSet
public int[] c
public static float[] hsb
Constructor Detail |
---|
public ColorPalette()
Method Detail |
---|
public void empty()
public void addSet(ColorSet _set)
_set
- public void getPalette()
public void savePalette(java.lang.String filename)
public int getRandomCol()
public void scramblePalette()
public void add(int col)
public void add(int col, int numcol)
col
- Color to addnumcol
- Number of copies to addpublic void add(float r, float g, float b)
public void add(float r, float g, float b, float a)
public void add(java.lang.String hex, int num)
public void add(java.lang.String hex)
public void addRange(float numrange, float r, float g, float b, float r2, float g2, float b2)
numrange
- Number of interpolated colors to addr
- g
- b
- r2
- g2
- b2
- public void addRange(float numrange, float r, float g, float b, float a, float r2, float g2, float b2, float a2)
numrange
- Number of interpolated colors to addr
- g
- b
- r2
- g2
- b2
- public void addRange(float numrange, int c1, int c2)
numrange
- Number of interpolated colors to addc1
- c2
- public void addRange(float numrange, java.lang.String hex1, java.lang.String hex2)
numrange
- Number of interpolated colors to addhex1
- Color 1 in hexadecimal formathex2
- Color 2 in hexadecimal format
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |