Documentation ¶
Overview ¶
Package pattern applies a kind of brush texture to a palette swatch.
Index ¶
- Variables
- func CropImage(img image.Image, crop image.Rectangle) (*ui.Image, error)
- func GetImage(filename string) (*ui.Image, error)
- func GetImageCropped(filename string, crop render.Rect) (*ui.Image, error)
- func GrayToColor(color, grayscale render.Color) render.Color
- func LoadBuiltins(e render.Engine)
- func OverlayFilter(a, b render.Color) render.Color
- func SampleColor(filename string, color render.Color, point render.Point) render.Color
- func ScreenFilter(a, b render.Color) render.Color
- type Pattern
Constants ¶
This section is empty.
Variables ¶
View Source
var Builtins = []Pattern{ { Name: "No pattern", Filename: "", }, { Name: "Noise", Filename: "noise.png", }, { Name: "Marker", Filename: "marker.png", }, { Name: "Ink", Filename: "ink.png", }, { Name: "Perlin Noise", Filename: "perlin-noise.png", }, { Name: "Bubbles", Filename: "bubbles.png", }, { Name: "Circles", Filename: "circles.png", }, { Name: "Grid", Filename: "grid.png", }, { Name: "Bars (debug)", Filename: "bars.png", Hidden: true, }, }
Builtins are the list of the game's built-in patterns.
Functions ¶
func CropImage ¶
CropImage crops an image to a smaller size (such as the 24x24 selectbox button in the Palette Editor UI)
func GetImageCropped ¶
GetImageCropped gets a cropped ui.Image for a builtin pattern.
func GrayToColor ¶
GrayToColor samples a colorful swatch with the grayscale pattern img.
func LoadBuiltins ¶
LoadBuiltins loads all of the PNG textures of built-in patterns into ui.Image widgets.
func OverlayFilter ¶
OverlayFilter applies an "overlay" blend mode between the two colors.
func SampleColor ¶
SampleColor samples a color with the pattern for a given coordinate in infinite space.
Types ¶
Click to show internal directories.
Click to hide internal directories.