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