public enum ColorModel extends Enum<ColorModel> implements EnumType<String>
ColorModel
s supported by GenericColor
. Please note that a
color typically has four segments
where only three of them are specific for the
ColorModel
and the fourth is Alpha
(opacity). So for each of these ColorModel
s
there is a notation with and without Alpha
. E.g. "rgb(255, 255, 255)" is the same as
"rgba(255, 255, 255, 1.0)".Enum Constant and Description |
---|
HSB
The indicator for the HSB color model, where HSB stands for the components
Hue ,
Saturation , and Brightness . |
HSL
The indicator for the HSL color model, where HSL stands for the components
Hue ,
Saturation , and Lightness . |
HSV
The indicator for the HSV color model.
|
RGB
|
Modifier and Type | Method and Description |
---|---|
abstract ColorSegmentType |
getFirstSegmentType() |
abstract ColorSegmentType |
getSecondSegmentType() |
abstract ColorSegmentType |
getThirdSegmentType() |
String |
getValue()
This method returns the raw value of this datatype.
|
String |
toString()
|
static ColorModel |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ColorModel[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ColorModel RGB
public static final ColorModel HSB
Hue
,
Saturation
, and Brightness
.public static final ColorModel HSV
HSB
with the only difference that
Brightness
is named value.public static final ColorModel HSL
Hue
,
Saturation
, and Lightness
.public static ColorModel[] values()
for (ColorModel c : ColorModel.values()) System.out.println(c);
public static ColorModel valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String toString()
String
representation of this Datatype
. While the general contract
of Object.toString()
is very weak and mainly used for debugging, the contract here is very
strong. The returned String
has to be suitable for end-users and official output to any kind of
sink. NlsMessage
for this purpose and implement
NlsObject
if you want to support I18N/L10N.public abstract ColorSegmentType getFirstSegmentType()
ColorSegmentType
of the first Segment
of this ColorModel
. E.g.
ColorSegmentType.RED
for RGB
.public abstract ColorSegmentType getSecondSegmentType()
ColorSegmentType
of the second Segment
of this ColorModel
. E.g.
ColorSegmentType.SATURATION_HSL
for HSL
.public abstract ColorSegmentType getThirdSegmentType()
ColorSegmentType
of the first Segment
of this ColorModel
. E.g.
ColorSegmentType.BRIGHTNESS
for HSB
.public String getValue()
String
, Character
, Boolean
, any type of Number
, any type of
java.time.LocalDate
, etc.).getValue
in interface AttributeReadValue<String>
getValue
in interface SimpleDatatype<String>
Copyright © 2001–2014 mmm-Team. All rights reserved.