Current section
Files
Jump to
Current section
Files
src/catppuccin.erl
-module(catppuccin).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([to_hex/1, to_rgb/1, to_hsl/1]).
-export_type([rgb/0, hsl/0, color/0]).
-type rgb() :: {rgb, integer(), integer(), integer()}.
-type hsl() :: {hsl, float(), float(), float()}.
-type color() :: {color, binary(), integer(), boolean(), binary(), rgb(), hsl()}.
-spec to_hex(color()) -> binary().
to_hex(Color) ->
erlang:element(5, Color).
-spec to_rgb(color()) -> rgb().
to_rgb(Color) ->
erlang:element(6, Color).
-spec to_hsl(color()) -> hsl().
to_hsl(Color) ->
erlang:element(7, Color).