schemes

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: MIT Imports: 6 Imported by: 2

Documentation

Overview

Package schemes provides standard color schemes from gheat.

These color schemes were converted from the pngs from gheat are made available for your convenience.

Index

Constants

This section is empty.

Variables

View Source
var AlphaFire []color.Color

AlphaFire is a gradient color scheme from transparent through red to yellow then white.

View Source
var Classic []color.Color

Classic is a color scheme that goes through a variety of colors.

View Source
var Fire []color.Color

Fire is a gradient color scheme from grey to white through red and yellow.

View Source
var OMG []color.Color

OMG is a gradient color scheme from purple through red to white.

View Source
var PBJ []color.Color

PBJ is a gradient color scheme from orange to purple.

View Source
var PGAitch []color.Color

PGAitch is a gradient color scheme from a dismal dark to a bright yellow.

Functions

func Build

func Build(spec SchemeSpec) []color.Color

Build generates a heatmap color scheme smoothly across the given scheme ranges.

func FromImage

func FromImage(filename string) ([]color.Color, error)

FromImage creates a color scheme from an image. The image should have all of the colors you want to use arranged vertically with the "coldest" on the bottom and the "hottest" on the top.

Types

type SchemeRange

type SchemeRange struct {
	// The starting color for this range
	From color.Color
	// The ending color for this range
	To color.Color
	// The number of colors to which this range should expand
	Steps int
}

A SchemeRange is a color range for computing a scheme.

type SchemeSpec

type SchemeSpec []SchemeRange

A SchemeSpec is a color generator specification.

Basically, this is just a bunch of start/stop points and colors along a range.

func (SchemeSpec) At

func (ss SchemeSpec) At(x, y int) color.Color

At satisfies the image.Image interface.

func (SchemeSpec) Bounds

func (ss SchemeSpec) Bounds() image.Rectangle

Bounds satisfies the image.Image interface.

func (SchemeSpec) ColorModel

func (ss SchemeSpec) ColorModel() color.Model

ColorModel satisfies the image.Image interface.

Jump to

Keyboard shortcuts

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