Skip to content

Commit

Permalink
added from black perspective to image generation (#109)
Browse files Browse the repository at this point in the history
* added from black perspective to image generation

* flipped black files

Co-authored-by: Logan Spears <[email protected]>
  • Loading branch information
notnil and Logan Spears authored Aug 14, 2022
1 parent bd57f68 commit 7c0de58
Show file tree
Hide file tree
Showing 5 changed files with 920 additions and 326 deletions.
12 changes: 12 additions & 0 deletions image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ mark := image.MarkSquares(yellow, chess.D2, chess.D4)
image.SVG(file, pos.Board(), mark)
```

### 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. The following
generates a board from Black's perspective:

```go
fromBlack := image.Perspective(chess.Black)
image.SVG(file, pos.Board(), fromBlack)
```

### Example Program

```go
Expand Down
Loading

0 comments on commit 7c0de58

Please sign in to comment.