summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorSergey Grebenshchikov <sgreben@gmail.com>2018-03-31 19:03:23 +0200
committerSergey Grebenshchikov <sgreben@gmail.com>2018-03-31 19:03:23 +0200
commitc172ba91228a8d4f5275f3e5a24e3462b906b2bc (patch)
treea6641b471c0a77b8c979522a6f1aa6214a5590fc /pkg
parent0aca02dc1e7ee25371e0d9f1d3d447973bd21b8b (diff)
Add full-escape canvas type1.1.10
Diffstat (limited to 'pkg')
-rw-r--r--pkg/draw/full.go4
-rw-r--r--pkg/draw/full_escape.go9
2 files changed, 12 insertions, 1 deletions
diff --git a/pkg/draw/full.go b/pkg/draw/full.go
index 6f234b0..dccdd9f 100644
--- a/pkg/draw/full.go
+++ b/pkg/draw/full.go
@@ -2,10 +2,12 @@ package draw
var _ Pixels = &Full{}
+const fullBlock = '█'
+
type Full struct{ *Buffer }
func (b *Full) Size() Box { return b.Box }
-func (b *Full) Set(y, x int) { b.Buffer.Set(y, x, '█') }
+func (b *Full) Set(y, x int) { b.Buffer.Set(y, x, fullBlock) }
func (b *Full) Clear() { b.Fill(' ') }
diff --git a/pkg/draw/full_escape.go b/pkg/draw/full_escape.go
new file mode 100644
index 0000000..e6a68de
--- /dev/null
+++ b/pkg/draw/full_escape.go
@@ -0,0 +1,9 @@
+package draw
+
+import "strings"
+
+const invertedSpace = "\033[7m \033[27m"
+
+func FullEscape(full string) string {
+ return strings.Replace(full, string(fullBlock), invertedSpace, -1)
+}