Package foundry.veil.api.client.color
Interface Colorc
- All Known Implementing Classes:
Color
public interface Colorc
An immutable view of a
Color
. All methods in this interface are pure.- Since:
- 1.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionfloat
alpha()
default int
alphaInt()
default int
argb()
float
blue()
default int
blueInt()
default Color
Mixes this color with black to "darken" it.default Color
Applies a grayscale filter to this color.float
green()
default int
greenInt()
default float
hue()
default Color
Inverts this color.default Color
Linearly interpolates between this color and the specified color.default Color
Mixes this color with white to "brighten" it.default float
default float
default float
default Color
Mixes this color with the specified color.float
red()
default int
redInt()
default int
rgb()
default float
default Color
Applies a sepia filter to this color.default Color
Converts the specified hue, saturation, and luminance values (HSV) to RGB.default Color
Converts the specified hue value (HSV) to RGB.default Color
setLuminance
(float luminance, Color store) Converts the specified luminance value (HSV) to RGB.default Color
setSaturation
(float saturation, Color store) Converts the specified saturation value (HSV) to RGB.
-
Method Details
-
red
@Contract(pure=true) float red()- Returns:
- The red component of this color
-
green
@Contract(pure=true) float green()- Returns:
- The green component of this color
-
blue
@Contract(pure=true) float blue()- Returns:
- The blue component of this color
-
alpha
@Contract(pure=true) float alpha()- Returns:
- The alpha component of this color
-
redInt
@Contract(pure=true) default int redInt()- Returns:
- The value of red as an int from 0 to 255
-
greenInt
@Contract(pure=true) default int greenInt()- Returns:
- The value of green as an int from 0 to 255
-
blueInt
@Contract(pure=true) default int blueInt()- Returns:
- The value of blue as an int from 0 to 255
-
alphaInt
@Contract(pure=true) default int alphaInt()- Returns:
- The value of alpha as an int from 0 to 255
-
rgb
@Contract(pure=true) default int rgb()- Returns:
- This color formatted as an int (RRGGBB)
-
argb
@Contract(pure=true) default int argb()- Returns:
- This color formatted as an int (AARRGGBB)
-
minComponent
@Contract(pure=true) default float minComponent()- Returns:
- The smallest color component (red, green, or blue)
-
maxComponent
@Contract(pure=true) default float maxComponent()- Returns:
- The largest color component (red, green, or blue)
-
hue
@Contract(pure=true) default float hue()- Returns:
- The angle in degrees around the color wheel
-
saturation
@Contract(pure=true) default float saturation()- Returns:
- The color saturation percentage
-
luminance
@Contract(pure=true) default float luminance()- Returns:
- The luminance percentage
-
lerp
Linearly interpolates between this color and the specified color.- Parameters:
other
- The other color to store indelta
- The delta from 0 to 1store
- The color to store in- Returns:
- The passed in color
-
mix
Mixes this color with the specified color.- Parameters:
color
- The color to mix withamount
- The amount of that color to mix from 0 to 1store
- The color to store in- Returns:
- The passed in color
-
lighten
Mixes this color with white to "brighten" it.- Parameters:
amount
- The amount of white to addstore
- The color to store in- Returns:
- The passed in color
-
darken
Mixes this color with black to "darken" it.- Parameters:
amount
- The amount of black to addstore
- The color to store in- Returns:
- The passed in color
-
invert
Inverts this color.- Parameters:
store
- The color to store in- Returns:
- The passed in color
-
grayscale
Applies a grayscale filter to this color.- Parameters:
store
- The color to store in- Returns:
- The passed in color
-
sepia
Applies a sepia filter to this color.- Parameters:
store
- The color to store in- Returns:
- The passed in color
-
setHue
Converts the specified hue value (HSV) to RGB.- Parameters:
hue
- The hue angle from 0 to 360 degreesstore
- The color to store the result in- Returns:
- The passed in color
-
setSaturation
Converts the specified saturation value (HSV) to RGB.- Parameters:
saturation
- The saturation percentage from 0 to 1store
- The color to store the result in- Returns:
- The passed in color
-
setLuminance
Converts the specified luminance value (HSV) to RGB.- Parameters:
luminance
- The brightness percentage from 0 to 1store
- The color to store the result in- Returns:
- The passed in color
-
setHSV
@Contract(pure=true) default Color setHSV(float hue, float saturation, float luminance, Color store) Converts the specified hue, saturation, and luminance values (HSV) to RGB.- Parameters:
hue
- The hue angle from 0 to 360 degreessaturation
- The saturation percentage from 0 to 1luminance
- The brightness percentage from 0 to 1store
- The color to store the result in- Returns:
- The passed in color
-