board

package
v0.0.0-...-f65e148 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ColNames = []string{"a", "b", "c", "d", "e", "f", "g", "h"}

ColNames is the list of column names in algebraic notation

View Source
var Themes = map[string]map[string]color.RGBA{
	"classic": map[string]color.RGBA{
		"black": color.RGBA{0, 0, 0, 255},
		"white": color.RGBA{255, 255, 255, 255},
	},
	"coral": map[string]color.RGBA{
		"black": color.RGBA{112, 162, 163, 255},
		"white": color.RGBA{177, 228, 185, 255},
	},
	"emerald": map[string]color.RGBA{
		"black": color.RGBA{111, 143, 114, 255},
		"white": color.RGBA{173, 189, 143, 255},
	},
	"sandcastle": map[string]color.RGBA{
		"black": color.RGBA{184, 139, 74, 255},
		"white": color.RGBA{227, 193, 111, 255},
	},
}

Themes is a collection of color themes for the board

Functions

This section is empty.

Types

type Map

type Map map[string]Square

Map is the type used to describe the map of board squares/shapes

func New

func New(originX, originY, size float64, blackFill, whiteFill color.RGBA) Map

New returns an array of *imdraw.IMDraw instances, each representing one square on a chess board. The size argument defines the width and height of each square. The blackFill and whiteFill arguments define what colors are used for the "black" and "white" squares.

type Square

type Square struct {
	Shape   *imdraw.IMDraw
	OriginX float64
	OriginY float64
}

Square represents one square of the board

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳