Skip to content

Commit 9a8d42d

Browse files
committed
update doc
1 parent c260a38 commit 9a8d42d

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ imaging example.png -c "*"
6767
```
6868

6969
imaging char names:
70+
* **charmap** specific color with specific char, enjoy it.
7071
* square "▇"
7172
* circle "●"
7273
* rectangle" "█"
@@ -80,7 +81,7 @@ imaging char names:
8081

8182
```javascript
8283
var imaging = require('imaging');
83-
imaging.draw('1.jpg', function (resp, status) {
84+
imaging.draw('example.jpg', function (resp, status) {
8485
/*
8586
if status == 'success', resp is the image charater string.
8687
conols.log(resp) to render the image in your terminal
@@ -91,7 +92,7 @@ imaging.draw('1.jpg', function (resp, status) {
9192
});
9293

9394
// limit the width for rendering
94-
imaging.draw('1.jpg', { width: 50}, function (resp, status) {
95+
imaging.draw('example.jpg', { width: 50}, function (resp, status) {
9596
/*
9697
if status == 'success', resp is the image charater string.
9798
conols.log(resp) to render the image in your terminal
@@ -119,7 +120,7 @@ __callback:__ `function (resp, status)`
119120

120121
__Source image:__
121122

122-
![source imh](http://switer.github.io/live/imaging_img.png)
123+
![source img](http://switer.github.io/live/imaging_img.png)
123124

124125
__Draw into terminal:__
125126

lib/runner.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function $render (width, height, left) {
7676
}
7777

7878
if (config.char[pix]) pix = config.char[pix]
79-
else if ( (pix != 'random' && pix.length > 1) || !pix) pix = config.char.default
79+
else if ( (pix != 'charmap' && pix.length > 1) || !pix) pix = config.char.default
8080

8181
$draw(colors, {
8282
left: left,
@@ -100,7 +100,7 @@ function $draw(colors, opts, cb) {
100100
var pixel
101101

102102
for (var i = 0; i < colors.length; i++) {
103-
if (opts.pixel == 'random') {
103+
if (opts.pixel == 'charmap') {
104104
pixel = charMap[opts.rgbColors[i]] || opts.pixel
105105
} else {
106106
pixel = opts.pixel

test/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var path = require('path')
44
var imaging = require('../index.js');
55

6-
imaging.draw(path.join(__dirname, '../res/i.png'), {width: 70, char: 'random'}, function (resp, status) {
6+
imaging.draw(path.join(__dirname, '../res/i.png'), {width: 70, char: 'charmap'}, function (resp, status) {
77
console.log(status);
88
console.log(resp);
99
});

0 commit comments

Comments
 (0)