github.com/notnil/chessimg

chess image utilities


License
MIT
Install
go get github.com/notnil/chessimg

Documentation

chessimg

GoDoc Build Status Coverage Status Go Report Card

Code Example

// create file
f, err := os.Create("example.svg")
if err != nil {
    log.Fatal(err)
}
// write image of position and marked squares to file
fenStr := "rnbqkbnr/pppppppp/8/8/3P4/8/PPP1PPPP/RNBQKBNR b KQkq - 0 1"
mark := chessimg.MarkSquares(color.RGBA{255, 255, 0, 1}, chess.D2, chess.D4)
if err := chessimg.New(f, mark).EncodeSVG(fenStr); err != nil {
    log.Fatal(err)
}

Resulting Image

rnbqkbnr/pppppppp/8/8/3P4/8/PPP1PPPP/RNBQKBNR b KQkq - 0 1