canvas

package
v0.0.0-...-75d14b7 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

type Canvas struct {
	Width  int
	Height int
	Pixels []Pixel
}

func New

func New(width, height int) Canvas

func (*Canvas) AddPixel

func (c *Canvas) AddPixel(x, y int, color color.Color) bool

func (*Canvas) GetPixel

func (c *Canvas) GetPixel(x, y int) (int, *Pixel)

func (*Canvas) SetColor

func (c *Canvas) SetColor(newColor color.Color)

SetColor sets all pixels' color to the given one

type Pixel

type Pixel struct {
	X     int
	Y     int
	Color color.Color
}

func NewPixel

func NewPixel(x, y int, color color.Color) Pixel

func (*Pixel) UpdateColor

func (p *Pixel) UpdateColor(newColor color.Color)

Jump to

Keyboard shortcuts

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