sketch

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package sketch provides utilities and color palettes for plotting graphs and images

Index

Constants

This section is empty.

Variables

View Source
var KellyPalette = color.Palette{
	color.RGBA{0xF2, 0xF3, 0xF4, 0xff},
	color.RGBA{0x22, 0x22, 0x22, 0xff},
	color.RGBA{0xF3, 0xC3, 0x00, 0xff},
	color.RGBA{0x87, 0x56, 0x92, 0xff},
	color.RGBA{0xF3, 0x84, 0x00, 0xff},
	color.RGBA{0xA1, 0xCA, 0xF1, 0xff},
	color.RGBA{0xBE, 0x00, 0x32, 0xff},
	color.RGBA{0xC2, 0xB2, 0x80, 0xff},
	color.RGBA{0x84, 0x84, 0x82, 0xff},
	color.RGBA{0x00, 0x88, 0x56, 0xff},
	color.RGBA{0xE6, 0x8F, 0xAC, 0xff},
	color.RGBA{0x00, 0x67, 0xA5, 0xff},
	color.RGBA{0xF9, 0x93, 0x79, 0xff},
	color.RGBA{0x60, 0x4E, 0x97, 0xff},
	color.RGBA{0xF6, 0xA6, 0x00, 0xff},
	color.RGBA{0xB3, 0x44, 0x6C, 0xff},
	color.RGBA{0xDC, 0xD3, 0x00, 0xff},
	color.RGBA{0x88, 0x2D, 0x17, 0xff},
	color.RGBA{0x8D, 0xB6, 0x00, 0xff},
	color.RGBA{0x65, 0x45, 0x22, 0xff},
	color.RGBA{0xE2, 0x58, 0x22, 0xff},
	color.RGBA{0x2B, 0x3D, 0x26, 0xff},
}

KellyPalette contains a set of high-contrast colors from: K. Kelly (1965): Twenty-two colors of maximum contrast. Color Eng., 3(6)

View Source
var TrubetskoyPalette = color.Palette{
	color.RGBA{0xe6, 0x19, 0x4b, 0xff},
	color.RGBA{0x3c, 0xb4, 0x4b, 0xff},
	color.RGBA{0xff, 0xe1, 0x19, 0xff},
	color.RGBA{0x00, 0x82, 0xc8, 0xff},
	color.RGBA{0xf5, 0x82, 0x31, 0xff},
	color.RGBA{0x91, 0x1e, 0xb4, 0xff},
	color.RGBA{0x46, 0xf0, 0xf0, 0xff},
	color.RGBA{0xf0, 0x32, 0xe6, 0xff},
	color.RGBA{0xd2, 0xf5, 0x3c, 0xff},
	color.RGBA{0xfa, 0xbe, 0xbe, 0xff},
	color.RGBA{0x00, 0x80, 0x80, 0xff},
	color.RGBA{0xe6, 0xbe, 0xbe, 0xff},
	color.RGBA{0xaa, 0x6e, 0x28, 0xff},
	color.RGBA{0xff, 0xfa, 0xc8, 0xff},
	color.RGBA{0x80, 0x00, 0x00, 0xff},
	color.RGBA{0xaa, 0xff, 0xcf, 0xff},
	color.RGBA{0x80, 0x80, 0x00, 0xff},
	color.RGBA{0xff, 0xd8, 0xb1, 0xff},
	color.RGBA{0x00, 0x00, 0x80, 0xff},
	color.RGBA{0x80, 0x80, 0x80, 0xff},
	color.RGBA{0xff, 0xff, 0xff, 0xff},
	color.RGBA{0x00, 0x00, 0x00, 0xff},
}

TrubetskoyPalette contains a set of high-contrast colors from: https://sashat.me/2017/01/11/list-of-20-simple-distinct-colors

Functions

func FilledRectangle

func FilledRectangle(img *image.RGBA, xOne, yOne, xTwo, yTwo int, col color.Color)

FilledRectangle draws a filled rectangle on the given image with the specified coordinates and color.

func HLine

func HLine(img *image.RGBA, xStart, xEnd, y int, col color.Color)

HLine draws a horizontal line on the given image between the xStart and xEnd coordinates at the y coordinate with the specified color.

func Rectangle

func Rectangle(img *image.RGBA, xOne, yOne, xTwo, yTwo int, col color.Color)

Rectangle draws a rectangle on the given image with the specified coordinates and color.

func Text

func Text(img *image.RGBA, label string, xStart, yStart int)

Text writes the specified label on the given image at the xStart and yStart coordinates.

func VLine

func VLine(img *image.RGBA, x, yStart, yEnd int, col color.Color)

VLine draws a vertical line on the given image between the yStart and yEnd coordinates at the x coordinate with the specified color.

Types

This section is empty.

Jump to

Keyboard shortcuts

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