Package com.teamdev.jxbrowser.ui
Class Color.Builder
java.lang.Object
com.teamdev.jxbrowser.ui.Color.Builder
- Enclosing interface:
- Color
A builder of
Color
.
Builders are created by invoking Color.newBuilder()
. Each of the setter methods
modifies the state of the builder and returns the same instance. Builders are not thread-safe
and should not be used concurrently from multiple threads without external synchronization.
-
Method Summary
Modifier and TypeMethodDescriptionalpha
(float alpha) Sets the alpha channel value in the0..1
range.blue
(float blue) Sets the blue channel value in the0..1
range.build()
Returns a newColor
instance built from the current state of this builder.green
(float green) Sets the green channel value in the0..1
range.red
(float red) Sets the red channel value in the0..1
range.
-
Method Details
-
red
Sets the red channel value in the0..1
range.- Parameters:
red
- the red channel value- Returns:
- this builder
- Throws:
IllegalArgumentException
- when thered
is out of the0..1
range
-
green
Sets the green channel value in the0..1
range.- Parameters:
green
- the green channel value- Returns:
- this builder
- Throws:
IllegalArgumentException
- when thegreen
is out of the0..1
range
-
blue
Sets the blue channel value in the0..1
range.- Parameters:
blue
- the blue channel value- Returns:
- this builder
- Throws:
IllegalArgumentException
- when theblue
is out of the0..1
range
-
alpha
Sets the alpha channel value in the0..1
range.- Parameters:
alpha
- the alpha channel value- Returns:
- this builder
- Throws:
IllegalArgumentException
- when thealpha
is out of the0..1
range
-
build
Returns a newColor
instance built from the current state of this builder.- Returns:
- a new
Color
instance
-