Documentation ¶
Overview ¶
Package pixel provides a virtual screen designed to display pixel art.
Index ¶
- func ClearPalette()
- func ColorCount() int
- func Err() error
- func PaletteC64()
- func PaletteCPC()
- func PaletteMSX()
- func PaletteMSX2()
- func PixelSize() int32
- func SetBackground(c colour.Colour)
- type Color
- type Coord
- func (p Coord) Minus(o Coord) Coord
- func (p Coord) Mod(s int16) Coord
- func (p Coord) ModCW(o Coord) Coord
- func (p Coord) Opposite() Coord
- func (p Coord) Plus(o Coord) Coord
- func (p Coord) Slash(s int16) Coord
- func (p Coord) SlashCW(o Coord) Coord
- func (p Coord) Times(s int16) Coord
- func (p Coord) TimesCW(o Coord) Coord
- func (p Coord) XY() (x, y float32)
- type Mode
- type Picture
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearPalette ¶
func ClearPalette()
func Err ¶
func Err() error
Err returns the first unchecked error of package pixel, and considers it checked.
func PaletteCPC ¶
func PaletteCPC()
func PaletteMSX ¶
func PaletteMSX()
func PaletteMSX2 ¶
func PaletteMSX2()
func SetBackground ¶
Types ¶
type Color ¶
type Color uint8
A Color identifies a color inside the palette.
func FindColor ¶
FindColor searches for a color by its colour.RGBA values. If this exact color isn't in the palette, the first color is returned, and ok is set to false.
func GetColor ¶
GetColor returns the color associated with a name. If there isn't any, the first color is returned, and a sticky error is set.
func NewColor ¶
NewColor adds a color to the palette and returns its index. The name must be either unique or empty.
Note: The palette contains a maximum of 256 colors.
type Coord ¶
type Coord struct {
X, Y int16
}
Coord represents a pair of coordinates on the virtual screen, in (virtual) pixels.
func ScreenSize ¶
func ScreenSize() Coord
func (Coord) Mod ¶
Mod returns the remainder (modulus) of the division by a scalar (which must be non-zero).
func (Coord) ModCW ¶
ModCW returns the remainder (modulus) of the component-wise division by another pair of coordinates (of which both X and Y must be non-zero).
func (Coord) Slash ¶
Slash returns the integer quotient of the division by a scalar (which must be non-zero).
func (Coord) SlashCW ¶
SlashCW returns the integer quotients of the component-wise division by another pair of coordinates (of which both X and Y must be non-zero).
type Picture ¶
type Picture struct {
// contains filtered or unexported fields
}
func GetPicture ¶
GetPicture returns the picture associated with a name. If there isn't any, an empty picture is returned, and a sticky error is set.