gradient

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClampRGB

func ClampRGB(value int) int

ClampRGB ensures RGB value stays within [0, 255].

func DarkenRGB

func DarkenRGB(rgb [3]int, ratio float64) [3]int

DarkenRGB decreases brightness toward black by ratio [0, 1].

func GradientFromColor

func GradientFromColor(primary tcell.Color, ratio float64, fallback config.Gradient) config.Gradient

GradientFromColor derives a gradient by lightening the base color.

func GradientFromColorVibrant

func GradientFromColorVibrant(primary tcell.Color, boost float64, fallback config.Gradient) config.Gradient

GradientFromColorVibrant derives a vibrant gradient by boosting RGB values.

func InterpolateColor

func InterpolateColor(gradient config.Gradient, t float64) tcell.Color

InterpolateColor is a convenience wrapper returning tcell.Color.

func InterpolateRGB

func InterpolateRGB(from, to [3]int, t float64) [3]int

InterpolateRGB performs linear RGB interpolation with proper rounding. t should be in [0, 1] range (automatically clamped).

func LightenRGB

func LightenRGB(rgb [3]int, ratio float64) [3]int

LightenRGB increases brightness toward white by ratio [0, 1].

func RenderAdaptiveGradientText

func RenderAdaptiveGradientText(text string, gradient config.Gradient, fallbackColor tcell.Color) string

RenderAdaptiveGradientText renders text with gradient or solid color based on config.UseGradients. When gradients are disabled, uses the gradient's end color as a solid color fallback.

func RenderGradientText

func RenderGradientText(text string, gradient config.Gradient) string

RenderGradientText renders text with character-by-character gradient coloring.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL