Class Colorf
java.lang.Object
io.github.shimeoki.jfx.rasterization.Colorf
Simple color class with float values.
Uses 4 (RGBA) color channels as floats to store the color.
- Since:
- 2.0.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfloat
alpha()
Gets this color's alpha channel.float
blue()
Gets this color's blue channel.float
green()
Gets this color's green channel.javafx.scene.paint.Color
jfxColor()
Gets aColor
representing this color.float
red()
Gets this color's red channel.float
Gets this color's transparency channel.
-
Constructor Details
-
Colorf
public Colorf(float r, float g, float b, float a) Creates a newColorf
instance.Uses
Floats.confined(0, v, 1)
to write the values.- Parameters:
r
- red color channel float valueg
- green color channel float valueb
- blue color channel float valuea
- alpha color channel float value- Since:
- 2.0.0
- See Also:
-
-
Method Details
-
red
public float red()Gets this color's red channel.- Returns:
- red color channel float value in range from 0.0 to 1.0
- Since:
- 2.0.0
-
green
public float green()Gets this color's green channel.- Returns:
- green color channel float value in range from 0.0 to 1.0
- Since:
- 2.0.0
-
blue
public float blue()Gets this color's blue channel.- Returns:
- blue color channel float value in range from 0.0 to 1.0
- Since:
- 2.0.0
-
alpha
public float alpha()Gets this color's alpha channel.Equivalent to:
1 - transparency()
- Returns:
- alpha color channel float value in range from 0.0 to 1.0
- Since:
- 2.0.0
- See Also:
-
transparency
public float transparency()Gets this color's transparency channel.Equivalent to:
1 - alpha()
- Returns:
- transparency color channel float value in range from 0.0 to 1.0
- Since:
- 2.0.0
- See Also:
-
jfxColor
public javafx.scene.paint.Color jfxColor()Gets aColor
representing this color.Creates a new instance everytime.
- Returns:
- JavaFX's
Color
class with equivalent color channels - Since:
- 2.0.0
- See Also:
-