Tint v1.0.0-rc.0 Tint.Lab View Source
A color in the CIELAB colorspace.
Link to this section Summary
Functions
Calculates the distance of two colors using the CIEDE2000 algorithm. See
Tint.Distance.CIEDE2000
for more details.
Converts a tuple containing lightness, a and b into Tint.Lab
struct.
Gets the nearest color from the given palette using the CIEDE2000 color distance algorithm.
Gets the n nearest colors from the given palette using the CIEDE2000 color distance algorithm.
Builds a new Lab color using the lightness, a and b color channels.
Converts a Lab color into a tuple containing the lightness, a and b channels.
Link to this section Types
Link to this section Functions
ciede2000_distance(color, other_color, opts \\ [])
View Source
ciede2000_distance(Tint.color(), Tint.color(), Keyword.t()) :: float()
ciede2000_distance(Tint.color(), Tint.color(), Keyword.t()) :: float()
Calculates the distance of two colors using the CIEDE2000 algorithm. See
Tint.Distance.CIEDE2000
for more details.
from_tuple(arg)
View Source
from_tuple(
{lightness :: float() | Decimal.decimal(), a :: float() | Decimal.decimal(),
b :: float() | Decimal.decimal()}
) :: t()
from_tuple( {lightness :: float() | Decimal.decimal(), a :: float() | Decimal.decimal(), b :: float() | Decimal.decimal()} ) :: t()
Converts a tuple containing lightness, a and b into Tint.Lab
struct.
nearest_color(color, palette, distance_calculator \\ Distance.CIEDE2000)
View Source
nearest_color(Tint.color(), [Tint.color()], Tint.Distance.distance_calculator()) ::
nil | Tint.color()
nearest_color(Tint.color(), [Tint.color()], Tint.Distance.distance_calculator()) :: nil | Tint.color()
Gets the nearest color from the given palette using the CIEDE2000 color distance algorithm.
Options
:weights
- A tuple defining the weights for the LCh color channels. Defaults to{1, 1, 1}
.
nearest_colors(color, palette, n, distance_calculator \\ Distance.CIEDE2000)
View Source
nearest_colors(
Tint.color(),
[Tint.color()],
non_neg_integer(),
Tint.Distance.distance_calculator()
) :: [Tint.color()]
nearest_colors( Tint.color(), [Tint.color()], non_neg_integer(), Tint.Distance.distance_calculator() ) :: [Tint.color()]
Gets the n nearest colors from the given palette using the CIEDE2000 color distance algorithm.
new(lightness, a, b)
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 Lab color using the lightness, a and b color channels.
to_tuple(color) View Source
Converts a Lab color into a tuple containing the lightness, a and b channels.