public final class ColorFactory
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ColorFactory.ColorSpecificationException |
Constructor and Description |
---|
ColorFactory() |
Modifier and Type | Method and Description |
---|---|
static Color |
createColor(java.lang.String colorspace,
float... data)
Creates a color value in the renderer's internal color space from a
string (representing the color space name) and an array of floating point
values.
|
static java.lang.String |
getInternalColorspace()
Return the name of the internal color space.
|
static int |
getRequiredDataValues(java.lang.String colorspace)
Checks to see how many values are required to specify a color using the
given colorspace.
|
public static java.lang.String getInternalColorspace()
null
in the following methods.public static int getRequiredDataValues(java.lang.String colorspace)
colorspace
- public static Color createColor(java.lang.String colorspace, float... data) throws ColorFactory.ColorSpecificationException
RuntimeException
if its parameters are not consistent. Here are
the currently supported color spaces:
"sRGB nonlinear"
- requires 3 values"sRGB linear"
- requires 3 values"XYZ"
- requires 3 valuesblackbody
- requires 1 value (temperature in Kelvins)spectrum [min] [max]
- any number of values (must be
>0), [start] and [stop] is the range over which the spectrum is defined
in nanometers.colorspace
- color space namedata
- data describing this colorColorFactory.ColorSpecificationException