|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlt.monarch.util.ColorUtil
public final class ColorUtil extends java.lang.Object
Utilities for color operations
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String[] |
pureColorNames
|
static java.awt.Color[] |
pureColors
|
| Constructor and Description |
|---|
ColorUtil()
|
| Modifier and Type | Method and Description |
|---|---|
static int |
alpha(int rgb)
Returns alpha component from sRGB ColorModel. |
static int |
argb(int a,
int r,
int g,
int b)
Returns RGB value of the color from sRGB ColorModel. |
static int |
argbv(int a,
int r,
int g,
int b)
Returns RGB value of the color from sRGB ColorModel. |
static int |
blue(int rgb)
Returns blue color component from sRGB ColorModel. |
static java.awt.Color |
changeBrightness(java.awt.Color color,
double multiplier)
Changes color brightness. |
static int |
changeBrightness(int color,
double multiplier)
Changes color brightness. |
static java.util.ArrayList<java.awt.Color> |
extendPalette(java.util.ArrayList<java.awt.Color> original,
int newCount)
|
static java.util.ArrayList<java.awt.Color> |
generateConvergingColors(int count,
java.awt.Color c1,
java.awt.Color c2)
|
static java.util.ArrayList<java.awt.Color> |
generateDivergingColors(int count,
java.awt.Color c1,
java.awt.Color c2,
java.awt.Color c3,
java.awt.Color c4)
|
static java.util.ArrayList<java.awt.Color> |
generateGenericColorVariations(java.awt.Color[] original,
int valueVar,
int valueVarCount)
|
static java.awt.Color[] |
getAnalogousColors(java.awt.Color original)
Returns three colors generated according to analogous harmony. |
static java.awt.Color |
getComplementaryColorFromHue(java.awt.Color primaryColor)
Returns complementary color by hue |
static java.awt.Color |
getComplementaryColorFromRGB(java.awt.Color original)
Returns three colors generated according to complement harmony. |
static java.awt.Color |
getComplementaryColorFromRYB(java.awt.Color primaryColor)
Returns complementary color to the given one according to the RYB (Red-Yellow-Blue) color wheel |
static java.util.ArrayList<java.awt.Color> |
getComplementaryColorsFromRYB(java.util.ArrayList<java.awt.Color> colors)
Vectorized version of getComplementaryColorFromRYB |
static java.awt.Color |
getDarkerColor(java.awt.Color original)
Gets darker color of the specified one |
static java.awt.Color |
getDarkerColor(java.awt.Color original,
float step)
Returns color which is darker than the given one by the given step. |
static java.awt.Color[] |
getSplitComplementsColors(java.awt.Color original)
Returns three colors generated according to split complements harmony. |
static java.awt.Color[] |
getTriadicColors(java.awt.Color original)
Returns three colors generated according to triadic harmony. |
static int |
gray(int rgb)
Returns gray color component from sRGB ColorModel. |
static int |
green(int rgb)
Returns green color component from sRGB ColorModel. |
static java.awt.Color |
interpolateHSB(java.awt.Color c1,
java.awt.Color c2,
double transition)
|
static int |
red(int rgb)
Returns red color component from sRGB ColorModel. |
static int |
rgb(int r,
int g,
int b)
Returns RGB value of the color from sRGB ColorModel. |
static int |
rgbv(int r,
int g,
int b)
Returns RGB value of the color from sRGB ColorModel. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.awt.Color[] pureColors
public static java.lang.String[] pureColorNames
| Constructor Detail |
|---|
public ColorUtil()
| Method Detail |
|---|
public static java.awt.Color changeBrightness(java.awt.Color color,
double multiplier)
color - color witch brightness will be changed.multiplier - multiplier of color brightness.Color object with changed brightness
public static int changeBrightness(int color,
double multiplier)
color - RGB value of the color witch brightness is changing.multiplier - multiplier of color brightness.Color object with changed brightness
public static int rgbv(int r,
int g,
int b)
r - red color component value.g - green color component value.b - blue color component value.
public static int rgb(int r,
int g,
int b)
r - red color component value.g - green color component value.b - blue color component value.
public static int argbv(int a,
int r,
int g,
int b)
a - alpha value of the color.r - red color component value.g - green color component value.b - blue color component value.
public static int argb(int a,
int r,
int g,
int b)
a - alpha value of the color.r - red color component value.g - green color component value.b - blue color component value.public static int gray(int rgb)
rgb - RGB value of the color.public static int alpha(int rgb)
rgb - RGB value of the color.public static int red(int rgb)
rgb - RGB value of the color.public static int green(int rgb)
rgb - RGB value of the color.public static int blue(int rgb)
rgb - RGB value of the color.
public static java.util.ArrayList<java.awt.Color> generateDivergingColors(int count,
java.awt.Color c1,
java.awt.Color c2,
java.awt.Color c3,
java.awt.Color c4)
public static java.util.ArrayList<java.awt.Color> generateConvergingColors(int count,
java.awt.Color c1,
java.awt.Color c2)
public static java.awt.Color interpolateHSB(java.awt.Color c1,
java.awt.Color c2,
double transition)
public static java.util.ArrayList<java.awt.Color> generateGenericColorVariations(java.awt.Color[] original,
int valueVar,
int valueVarCount)
public static java.util.ArrayList<java.awt.Color> extendPalette(java.util.ArrayList<java.awt.Color> original,
int newCount)
public static java.awt.Color getDarkerColor(java.awt.Color original)
original - input color
public static java.awt.Color getDarkerColor(java.awt.Color original,
float step)
original - Original colorstep - Step by which to darken the given color. Step should be in interval [0; 1]public static java.awt.Color[] getTriadicColors(java.awt.Color original)
public static java.awt.Color[] getSplitComplementsColors(java.awt.Color original)
public static java.awt.Color[] getAnalogousColors(java.awt.Color original)
public static java.awt.Color getComplementaryColorFromRGB(java.awt.Color original)
public static java.awt.Color getComplementaryColorFromRYB(java.awt.Color primaryColor)
public static java.util.ArrayList<java.awt.Color> getComplementaryColorsFromRYB(java.util.ArrayList<java.awt.Color> colors)
public static java.awt.Color getComplementaryColorFromHue(java.awt.Color primaryColor)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||