]>
git.r.bdr.sh - rbdr/tomato-sauce/blob - lib/renderers/ansi.js
b3a461d5f449f37cba1c2bac66887a11c7913c19
4 * Returns a basic ansi color, see https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
7 * @function ANSIRenderer
8 * @implements IRenderer
10 module
.exports = function (red
, blue
, green
) {
12 const colorOffset
= Math
.round((red
+ blue
+ green
) * 7 / (255 * 3));
13 const colorNumber
= 40 + colorOffset
;
15 return `\x1B[${colorNumber}m`;