Tint v0.2.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.

Builds a new HSV color from hue, saturation and value color parts. Please always use this function to build a new HSV struct from hue, saturation and value color components.

Converts HSV color into a tuple containing the hue, saturation and value parts.

Link to this section Types

Link to this type

t() View Source
t() :: %Tint.HSV{hue: Decimal.t(), saturation: Decimal.t(), value: Decimal.t()}

Link to this section Functions

Link to this function

from_tuple(arg) View Source
from_tuple(
  {Decimal.t() | number(), Decimal.t() | number(), Decimal.t() | number()}
) :: t()

Converts a tuple containing hue, saturation and value into a Tint.HSV struct.

Link to this function

new(hue, saturation, value) View Source
new(Decimal.t() | number(), Decimal.t() | number(), Decimal.t() | number()) ::
  t()

Builds a new HSV color from hue, saturation and value color parts. Please always use this function to build a new HSV struct from hue, saturation and value color components.

Examples

iex> Tint.HSV.new(25.8, 0.882, 1)
#Tint.HSV<25.8°,88.2%,100%>
Link to this function

to_tuple(color) View Source
to_tuple(t()) :: {float(), float(), float()}

Converts HSV color into a tuple containing the hue, saturation and value parts.