Raxol. Effects. BorderBeam. Colors
(Raxol v2.6.1)
View Source
Color palettes and gradient logic for the BorderBeam effect.
Four variants mirroring the original border-beam React component: colorful (rainbow), mono (grayscale), ocean (blue-purple), sunset (orange-red).
Summary
Functions
Returns the beam head color at the given animation progress.
Returns the dim outer bloom color for a variant.
Returns CSS hex for the bloom color of a variant.
Returns CSS hex for the glow color of a variant.
Returns CSS gradient stops string for the conic-gradient beam stroke.
Returns the CSS hex palette for a variant.
Returns the muted inner glow color for a variant.
Returns the terminal color palette for a variant.
Returns the palette as a tuple for O(1) elem/2 access. Use this in
per-cell hot loops to avoid the O(n) cost of Enum.at(list, idx).
Returns {palette_tuple, length} for a variant in one call. Convenience
for per-cell hot loops that need both the O(1)-access tuple and its size,
avoiding a separate tuple_size/1 at each call site.
Returns the trail color for a cell at distance_normalized (0.0-1.0)
behind the beam head.
Types
@type color() :: atom()
@type variant() :: :colorful | :mono | :ocean | :sunset | :electric | :neon | :matrix
Functions
Returns the beam head color at the given animation progress.
progress is 0.0-1.0 through the animation cycle.
When static_colors is true, always returns the first palette color.
Returns the dim outer bloom color for a variant.
Returns CSS hex for the bloom color of a variant.
Returns CSS hex for the glow color of a variant.
Returns CSS gradient stops string for the conic-gradient beam stroke.
Returns the CSS hex palette for a variant.
Returns the muted inner glow color for a variant.
Returns the terminal color palette for a variant.
Returns the palette as a tuple for O(1) elem/2 access. Use this in
per-cell hot loops to avoid the O(n) cost of Enum.at(list, idx).
@spec palette_tuple_with_len(variant()) :: {tuple(), non_neg_integer()}
Returns {palette_tuple, length} for a variant in one call. Convenience
for per-cell hot loops that need both the O(1)-access tuple and its size,
avoiding a separate tuple_size/1 at each call site.
Returns the trail color for a cell at distance_normalized (0.0-1.0)
behind the beam head.