Current section

Files

Jump to
catppuccin src catppuccin.erl
Raw

src/catppuccin.erl

-module(catppuccin).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([hex/1, rgb/1, hsl/1]).
-export_type([rgb/0, hsl/0, color/0]).
-type rgb() :: {rgb, integer(), integer(), integer()}.
-type hsl() :: {hsl, integer(), float(), float()}.
-type color() :: {color, binary(), rgb(), hsl()}.
-spec hex(color()) -> binary().
hex(Color) ->
erlang:element(2, Color).
-spec rgb(color()) -> rgb().
rgb(Color) ->
erlang:element(3, Color).
-spec hsl(color()) -> hsl().
hsl(Color) ->
erlang:element(4, Color).