vcolor

package
v0.0.0-...-6d0822f Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ColorNames = map[string]color.Color{
	"transparent": color.Transparent,
	"opaque":      color.Opaque,

	"black":   color.Black,
	"silver":  color.RGBA{192, 192, 192, 255},
	"gray":    color.RGBA{128, 128, 128, 255},
	"grey":    color.RGBA{128, 128, 128, 255},
	"white":   color.White,
	"maroon":  color.RGBA{128, 0, 0, 255},
	"red":     color.RGBA{255, 0, 0, 255},
	"purple":  color.RGBA{128, 0, 128, 255},
	"fuchsia": color.RGBA{255, 0, 255, 255},
	"green":   color.RGBA{0, 128, 0, 255},
	"lime":    color.RGBA{0, 255, 0, 255},
	"olive":   color.RGBA{128, 128, 0, 255},
	"yellow":  color.RGBA{255, 255, 0, 255},
	"navy":    color.RGBA{0, 0, 128, 255},
	"blue":    color.RGBA{0, 0, 255, 255},
	"teal":    color.RGBA{0, 128, 128, 255},
	"aqua":    color.RGBA{0, 255, 255, 255},
}

CSS color names from "Basic color keywords" https://www.w3.org/TR/css-color-3/#html4 plus some extra

Functions

func ColorfulToHex

func ColorfulToHex(c colorful.Color, a byte) string

func RGBAToHex

func RGBAToHex(r, g, b, a byte) string

func String

func String(input string) (color.Color, error)

func StringRGBA

func StringRGBA(input string) (r, g, b, a byte, err error)

func ToColorful

func ToColorful(in color.Color) (colorful.Color, byte)

Types

This section is empty.

Jump to

Keyboard shortcuts

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