Documentation
¶
Index ¶
- func DefaultGradient() render.Gradient
- func FormatGradientString(g render.Gradient) string
- func FormatHex(c sg.Color) string
- func FormatHexA(c sg.Color) string
- func FromHSL(h, s, l, a float64) sg.Color
- func FromHSV(h, s, v, a float64) sg.Color
- func FromRGB255(r, g, b, a int) sg.Color
- func NormalizeRGB(c sg.Color) sg.Color
- func ParseHex(s string) (sg.Color, bool)
- func SampleBilinear(g render.GradientColors, u, v float64) sg.Color
- func ToHSL(c sg.Color) (h, s, l, a float64)
- func ToHSV(c sg.Color) (h, s, v, a float64)
- func ToRGB255(c sg.Color) (r, g, b, a int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultGradient ¶
DefaultGradient returns a horizontal black→white gradient.
func FormatGradientString ¶
FormatGradientString returns the theme-compatible JSON fill string for g, using the most compact form: gradientH/gradientV when applicable, else gradient.
func FromRGB255 ¶
FromRGB255 converts 0–255 integers to a sg.Color.
func NormalizeRGB ¶
NormalizeRGB clamps R, G, B to [0, 1] for use with standard color-space conversions. Alpha is passed through unchanged. This preserves the hue and saturation ratio of overbright tint colors.
func SampleBilinear ¶
func SampleBilinear(g render.GradientColors, u, v float64) sg.Color
SampleBilinear returns the bilinearly interpolated color at normalized (u, v) where (0,0)=TopLeft, (1,1)=BottomRight.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.