Skip to content

Commit

Permalink
Fix demo for expand grayscale and add one more example project
Browse files Browse the repository at this point in the history
  • Loading branch information
kutuluk committed Oct 8, 2015
1 parent 05c8827 commit 4f9984b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ There are also some interesting projects using termbox-go:
- [mop](https://github.com/michaeldv/mop) is stock market tracker for hackers.
- [termui](https://github.com/gizak/termui) is a terminal dashboard.
- [termloop](https://github.com/JoelOtter/termloop) is a terminal game engine.
- [xterm-color-chart](https://github.com/kutuluk/xterm-color-chart) is a XTerm 256 color chart.

### API reference
[godoc.org/github.com/nsf/termbox-go](http://godoc.org/github.com/nsf/termbox-go)
16 changes: 8 additions & 8 deletions _demos/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,24 @@ func draw_all() {
print_wide(2+len(chars), 11, hello_world)

case termbox.OutputGrayscale:
for y := 0; y < 24; y++ {
for x := 0; x < 24; x++ {
for y := 0; y < 26; y++ {
for x := 0; x < 26; x++ {
termbox.SetCell(x, y, 'n',
termbox.Attribute(x+1),
termbox.Attribute(y+1))
termbox.SetCell(x+25, y, 'b',
termbox.SetCell(x+27, y, 'b',
termbox.Attribute(x+1)|termbox.AttrBold,
termbox.Attribute(24-y))
termbox.SetCell(x+50, y, 'u',
termbox.Attribute(26-y))
termbox.SetCell(x+54, y, 'u',
termbox.Attribute(x+1)|termbox.AttrUnderline,
termbox.Attribute(y+1))
}
termbox.SetCell(76, y, 'd',
termbox.SetCell(82, y, 'd',
termbox.Attribute(y+1),
termbox.ColorDefault)
termbox.SetCell(77, y, 'd',
termbox.SetCell(83, y, 'd',
termbox.ColorDefault,
termbox.Attribute(24-y))
termbox.Attribute(26-y))
}

case termbox.Output216:
Expand Down

0 comments on commit 4f9984b

Please sign in to comment.