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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatalpha()Gets this color's alpha channel.floatblue()Gets this color's blue channel.floatgreen()Gets this color's green channel.javafx.scene.paint.ColorjfxColor()Gets aColorrepresenting this color.floatred()Gets this color's red channel.floatGets this color's transparency channel.
-
Constructor Details
-
Colorf
public Colorf(float r, float g, float b, float a) Creates a newColorfinstance.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 aColorrepresenting this color.Creates a new instance everytime.
- Returns:
- JavaFX's
Colorclass with equivalent color channels - Since:
- 2.0.0
- See Also:
-