Tint v1.0.0-rc.0 Tint.HSV View Source
A color in the HSV (hue, saturation, value) colorspace.
Link to this section Summary
Functions
Converts a tuple containing hue, saturation and value into a Tint.HSV
struct.
Determines whether the given color is a grayscale color which basically means that saturation or the value is 0.
Checks whether the hue of the given color is in the specified bounds. This can be used to cluster colors by their chromaticity.
Builds a new HSV color from hue, saturation and value color parts. Please always use this function to build a new HSV color.
Converts HSV color into a tuple containing the hue, saturation and value parts.
Link to this section Types
Link to this section Functions
from_tuple(arg)
View Source
from_tuple(
{hue :: float() | Decimal.decimal(),
saturation :: float() | Decimal.decimal(),
value :: float() | Decimal.decimal()}
) :: t()
from_tuple( {hue :: float() | Decimal.decimal(), saturation :: float() | Decimal.decimal(), value :: float() | Decimal.decimal()} ) :: t()
Converts a tuple containing hue, saturation and value into a Tint.HSV
struct.
grayscale?(color) View Source (since 1.0.0)
Determines whether the given color is a grayscale color which basically means that saturation or the value is 0.
hue_between?(color, min, max)
View Source
(since 1.0.0)
hue_between?(
t(),
min :: float() | Decimal.decimal(),
max :: float() | Decimal.decimal()
) :: boolean()
hue_between?( t(), min :: float() | Decimal.decimal(), max :: float() | Decimal.decimal() ) :: boolean()
Checks whether the hue of the given color is in the specified bounds. This can be used to cluster colors by their chromaticity.
new(hue, saturation, value)
View Source
new(
float() | Decimal.decimal(),
float() | Decimal.decimal(),
float() | Decimal.decimal()
) :: t()
new( float() | Decimal.decimal(), float() | Decimal.decimal(), float() | Decimal.decimal() ) :: t()
Builds a new HSV color from hue, saturation and value color parts. Please always use this function to build a new HSV color.
Examples
iex> Tint.HSV.new(25.8, 0.882, 1)
#Tint.HSV<25.8°,88.2%,100%>
to_tuple(color) View Source
Converts HSV color into a tuple containing the hue, saturation and value parts.