summaryrefslogtreecommitdiff
path: root/lib/renderers/ansi.js
diff options
context:
space:
mode:
authorRubén Beltran del Río <ben@nsovocal.com>2018-06-26 22:00:10 +0000
committerRubén Beltran del Río <ben@nsovocal.com>2018-06-26 22:00:10 +0000
commitfd38d4096e65ba5afba8ed1ddc75ed1814ca8c16 (patch)
tree4d2c7a991fcc6510431af72225f7cea2c450f86a /lib/renderers/ansi.js
parentbe12c97f83026087e0974fc54508b09c3154c9eb (diff)
Update Documentation
Diffstat (limited to 'lib/renderers/ansi.js')
-rw-r--r--lib/renderers/ansi.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/renderers/ansi.js b/lib/renderers/ansi.js
index c3975da..b3a461d 100644
--- a/lib/renderers/ansi.js
+++ b/lib/renderers/ansi.js
@@ -1,13 +1,16 @@
'use strict';
-// Returns a basic ANSI color. See the color table in:
-// https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
-const ANSI = function (red, blue, green) {
- let colorOffset = Math.round((red + blue + green) * 7 / (255 * 3));
+/**
+ * Returns a basic ansi color, see https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
+ * for more info.
+ *
+ * @function ANSIRenderer
+ * @implements IRenderer
+ */
+module.exports = function (red, blue, green) {
- let colorNumber = 40 + colorOffset;
+ const colorOffset = Math.round((red + blue + green) * 7 / (255 * 3));
+ const colorNumber = 40 + colorOffset;
return `\x1B[${colorNumber}m`;
};
-
-module.exports = ANSI;