color

package module
v0.0.0-...-e95d97f Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2013 License: BSD-2-Clause Imports: 1 Imported by: 2

README

term.color

image/color style model for 256 color terminals

term.colorwheel

To convert color.Color to closest 256 color terminal value you can do:

// var c color.Color
val := color.Term256Model.Convert(c).(color.Term256).Val

or you can get closest greyscale value (intensity) with

// var c color.Color
val := color.Term256GreyscaleModel.Convert(c).(color.Term256).Val

Documentation

Overview

Package color handles conversion from 256 color terminal colors into other color models.

Index

Constants

This section is empty.

Variables

View Source
var (
	Term256Model          color.Model = color.ModelFunc(term256Model)
	Term256GreyscaleModel color.Model = color.ModelFunc(term256GreyscaleModel)
)

Functions

This section is empty.

Types

type Term256

type Term256 struct {
	Val uint8
}

Term256 satisfies color.Color interface, complete with color.ModelFuncs for converting between color models.

func (Term256) RGBA

func (c Term256) RGBA() (r, g, b, a uint32)

Jump to

Keyboard shortcuts

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