Back to godoc.org
barista.run / colors

Package colors

v0.0.0-...-30db6b9
Latest Go to latest

The latest major version is .

Published: 5 days ago | License: Apache-2.0 | Module: barista.run

Overview

Package colors provides helper functions to manage color and color schemes.

Index

func LoadBarConfig

func LoadBarConfig()

LoadBarConfig automatically loads colors from the current bar's configuration. It assumes that the parent process is the i3bar instance, and the bar_id command-line flag identifies the bar id.

func LoadFromArgs

func LoadFromArgs(args []string)

LoadFromArgs loads a color scheme from command-line arguments of the form name=value.

func LoadFromConfig

func LoadFromConfig(filename string) error

LoadFromConfig loads a color scheme from a i3status config file by reading all keys that start with 'color_'

func LoadFromMap

func LoadFromMap(s map[string]string)

LoadFromMap sets the colour scheme from code.

func Set

func Set(name string, color color.Color)

Set sets a named scheme color to the given value.

type ColorfulColor

type ColorfulColor interface {
	color.Color
	Colorful() colorful.Color
}

ColorfulColor extends image/color.Color with the ability to get a go-colorful.Color. This is simpler than using go-colorful.MakeColor because the backing implementation already has a colorful value.

func Hex

func Hex(hex string) ColorfulColor

Hex sanity-checks and constructs a color from a hex-string. Any string that can be parsed by colorful is acceptable.

func Scheme

func Scheme(name string) ColorfulColor

Scheme gets a color from the user-defined color scheme. Some common names are 'good', 'bad', and 'degraded'.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier