redshift

package
v0.0.0-...-30cb9ea Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package redshift is a minimal pure-go implementation of color temperature shifting using gamma ramps with support for X11.

Inspired by https://github.com/jonls/redshift.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorRamp

func ColorRamp[T ~uint8 | uint16 | ~uint32 | uint64, U ~float32 | ~float64](whiteR, whiteG, whiteB U, size int) (r, g, b []T)

ColorRamp calculates the gamma ramp with the specified parameters. Use a value of 1 for the white values for the default ramp.

func ColorRampX11

func ColorRampX11[U ~float32 | ~float64](conn *xgb.Conn, whiteR, whiteG, whiteB U) error

ColorRampX11 applies a color ramp to all CRTCs on the specified connection. The RandR extension must be initialized.

func WhitePoint

func WhitePoint(temperature int) (r, g, b float32, ok bool)

WhitePoint gets the white point of the provided color temperature. If the temperature is out of range, the closest temperature is returned, and ok is set to false.

https://github.com/jonls/redshift/blob/490ba2aae9cfee097a88b6e2be98aeb1ce990050/src/colorramp.c

Types

This section is empty.

Jump to

Keyboard shortcuts

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