Documentation
¶
Overview ¶
Package image is a go library that creates images from board positions
Index ¶
- func Arrow(from, to chess.Square) arrow
- func MarkArrows(arrows ...arrow) func(*Encoder)
- func MarkSquares(c color.Color, sqs ...chess.Square) func(*Encoder)
- func Perspective(c chess.Color) func(*Encoder)
- func SVG(w io.Writer, b *chess.Board, opts ...func(*Encoder)) error
- func SquareColors(light, dark color.Color) func(*Encoder)
- type Encoder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarkArrows ¶
func MarkArrows(arrows ...arrow) func(*Encoder)
MarkArrows is designed to be used as an optional argument to the SVG function. It marks an arrow between the given squares with the an Arrow of the given color.
func MarkSquares ¶
MarkSquares is designed to be used as an optional argument to the SVG function. It marks the given squares with the color. A possible usage includes marking squares of the previous move.
func Perspective ¶
Perspective is designed to be used as an optional argument to the SVG function. It draws the board from the perspective of the given color. White is the default.
func SVG ¶
SVG writes the board SVG representation into the writer. An error is returned if there is there is an error writing data. SVG also takes options which can customize the image output.
func SquareColors ¶
SquareColors is designed to be used as an optional argument to the SVG function. It changes the default light and dark square colors to the colors given.