Documentation ¶
Overview ¶
Package pixkey implements a simple color key for landscape pixelations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PixKey ¶
type PixKey struct {
// contains filtered or unexported fields
}
PixKey stores the color values for a pixel value.
func Read ¶
Read reads a key file used to define the colors for pixel values in a time pixelation.
A key file is a tab-delimited file with the following required columns:
-key the value used as identifier -color an RGB value separated by commas, for example "125,132,148".
Optionally it can contain the following columns:
-gray: for a gray scale value
Any other columns, will be ignored. Here is an example of a key file:
key color gray comment 0 0, 26, 51 0 deep ocean 1 0, 84, 119 10 oceanic plateaus 2 68, 167, 196 20 continental shelf 3 251, 236, 93 90 lowlands 4 255, 165, 0 100 highlands 5 229, 229, 224 50 ice sheets
func (*PixKey) Color ¶
Color returns the color associated with a given value. If no color is defined for the value, it will return transparent black.
func (*PixKey) Gray ¶
Gray returns the gray color associated with a given value. If no color is defined for the value, it will return transparent black.
func (*PixKey) HasGrayScale ¶
HasGrayScale returns true if a gray scale is defined for the keys.