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..1range.blue(float blue) Sets the blue channel value in the0..1range.build()Returns a newColorinstance built from the current state of this builder.green(float green) Sets the green channel value in the0..1range.red(float red) Sets the red channel value in the0..1range.
-
Method Details
-
red
Sets the red channel value in the0..1range.- Parameters:
red- the red channel value- Returns:
- this builder
- Throws:
IllegalArgumentException- when theredis out of the0..1range
-
green
Sets the green channel value in the0..1range.- Parameters:
green- the green channel value- Returns:
- this builder
- Throws:
IllegalArgumentException- when thegreenis out of the0..1range
-
blue
Sets the blue channel value in the0..1range.- Parameters:
blue- the blue channel value- Returns:
- this builder
- Throws:
IllegalArgumentException- when theblueis out of the0..1range
-
alpha
Sets the alpha channel value in the0..1range.- Parameters:
alpha- the alpha channel value- Returns:
- this builder
- Throws:
IllegalArgumentException- when thealphais out of the0..1range
-
build
Returns a newColorinstance built from the current state of this builder.- Returns:
- a new
Colorinstance
-