public final class ColorHelper extends Object
A helper class for dealing with colors.
This class defines helper methods for converting color values specified in form builder Jelly scripts. In this model colors can be defined in the following different ways:
java.awt.Color
class.#80FF80
. This is
analogous to color definitions in HTML.(r, g, b)
, with r, g, b in the range from 0 to 255.~MyStyle
.Modifier and Type | Class and Description |
---|---|
static class |
ColorHelper.NamedColor
An enumeration with predefined color constants.
|
Modifier and Type | Method and Description |
---|---|
static Color |
getPredefinedColor(String name)
Returns the predefined color with the given name.
|
static Iterator<String> |
getPredefinedNames()
Returns an iterator with the names (Strings) of all predefined colors.
|
static Color |
resolveColor(String c)
The main method for resolving a color definition.
|
public static Color getPredefinedColor(String name) throws FormBuilderException
getPredefinedNames()
method (case does not matter).name
- the name of the desired colorFormBuilderException
- if this color does not existpublic static Iterator<String> getPredefinedNames()
getPredefinedColor()
method.public static Color resolveColor(String c) throws FormBuilderException
Color
object. If this fails, an exception will be thrown.c
- the color definitionFormBuilderException
- if the color definition cannot be resolvedCopyright © 2016 The JGUIraffe Team. All rights reserved.