Documentation
¶
Overview ¶
Package pulse provides pulse animation rendering for clog.
Index ¶
Constants ¶
const ( // Speed is the number of full oscillation cycles per second. Speed = 0.5 // TickRate is the repaint interval when pulse is active (~30fps). TickRate = 33 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
func DefaultGradient ¶
DefaultGradient returns a three-stop gradient for pulse effects: pastel light blue fading through light green to white.
func Text ¶
Text renders all characters of text with a single gradient-interpolated foreground color, creating an animated pulse when called with advancing phase values. Spaces are passed through unstyled.
func TextCached ¶
TextCached is like Text but reuses the cached style when the interpolated hex color matches the previous call. Pass a persistent *Cache across frames to avoid style allocations when the color is stable between ticks.
Types ¶
type Cache ¶
Cache holds the last-used hex color and its corresponding lipgloss style, allowing TextCached to skip style creation when the color hasn't changed between frames.
type Option ¶
type Option func(*Style)
Option configures a Style.
func WithGradient ¶
WithGradient sets custom gradient color stops.
type Style ¶
Style holds resolved pulse configuration.
func ApplyOptions ¶
ApplyOptions applies options over DefaultStyle and returns the resolved config.