pattern

package
v0.0.0-...-79996cc Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package pattern applies a kind of brush texture to a palette swatch.

Index

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

func CropImage(img image.Image, crop image.Rectangle) (*ui.Image, error)

CropImage crops an image to a smaller size (such as the 24x24 selectbox button in the Palette Editor UI)

func GetImage

func GetImage(filename string) (*ui.Image, error)

GetImage returns the ui.Image for a builtin pattern.

func GetImageCropped

func GetImageCropped(filename string, crop render.Rect) (*ui.Image, error)

GetImageCropped gets a cropped ui.Image for a builtin pattern.

func GrayToColor

func GrayToColor(color, grayscale render.Color) render.Color

GrayToColor samples a colorful swatch with the grayscale pattern img.

func LoadBuiltins

func LoadBuiltins(e render.Engine)

LoadBuiltins loads all of the PNG textures of built-in patterns into ui.Image widgets.

func OverlayFilter

func OverlayFilter(a, b render.Color) render.Color

OverlayFilter applies an "overlay" blend mode between the two colors.

func SampleColor

func SampleColor(filename string, color render.Color, point render.Point) render.Color

SampleColor samples a color with the pattern for a given coordinate in infinite space.

func ScreenFilter

func ScreenFilter(a, b render.Color) render.Color

ScreenFilter applies a "screen" blend mode between the two colors (a > b).

Types

type Pattern

type Pattern struct {
	Name     string
	Filename string
	Hidden   bool // boolProp showHiddenDoodads true
}

Pattern applies a texture to a color in level drawings.

Jump to

Keyboard shortcuts

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