'use strict'; /** * 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) { const colorOffset = Math.round((red + blue + green) * 7 / (255 * 3)); const colorNumber = 40 + colorOffset; return `\x1B[${colorNumber}m`; };