utils

package
v0.0.0-...-463e26a Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

This package contains a few utilities that can be used with golor. See the demo in the cmd directory to see an example of their usage

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HslGradient

func HslGradient(startRGB, endRGB uint32, steps int) iter.Seq2[int, uint32]

Use the HSL model to create a pleasant gradient of color with the given number of steps from the start to the specified end. Note that the start and end consist of a combination of red, green and blue and thus, they are given as uint32

func HslToRgb

func HslToRgb(h, s, l float64) (r, g, b uint8)

Given the Hue, Saturation and Lightness of a combination of red, green and blue, return its three primary colors as bytes

func RgbToHsl

func RgbToHsl(r, g, b uint8) (h, s, l float64)

Given three bytes with R, G and B values, return the Hue, Saturation and Lightness of its combination

Types

This section is empty.

Jump to

Keyboard shortcuts

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