ok

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package ok contains OKLab/OKLch color implementations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Color

type Color struct {
	L, A, B float64
}

Color is an OKLab/OKLch color.

func FromRGB

func FromRGB(c blcolor.Color) Color

FromRGB creates a new ok color from a linear RGB color.

func FromRGBIntValues added in v0.9.2

func FromRGBIntValues(r, g, b int) Color

FromRGBIntValues creates a new ok color from red, green and blue int values (0-255)

func FromRGBValues

func FromRGBValues(r, g, b float64) Color

FromRGBValues creates a new ok color from red, green and blue values.

func Lab added in v0.9.2

func Lab(l, a, b float64) Color

Lab creates a new ok color from l, a, b values.

func Lch added in v0.9.2

func Lch(l, c, h float64) Color

Lch creates a new ok color from l, c, h values.

func Lerp

func Lerp(col0, col1 Color, t float64) Color

Lerp Interpolates between two ok colors.

func (Color) Hue added in v0.9.2

func (c Color) Hue() float64

Hue returns the hue of this color as an angle from 0 to 360 degrees.

func (Color) ToLinearSRGB

func (c Color) ToLinearSRGB() blcolor.Color

ToLinearSRGB converts this ok color to a linear RGB color.

func (Color) ToSRGB

func (c Color) ToSRGB() blcolor.Color

ToSRGB converts this ok color to a standard RGB color.

Jump to

Keyboard shortcuts

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