]> git.r.bdr.sh - rbdr/tomato-sauce/blame - lib/renderers/true_color.js
Merge branch 'feature/the-actual-tomato-sauce' into develop
[rbdr/tomato-sauce] / lib / renderers / true_color.js
CommitLineData
c7b4bd19
BB
1'use strict';
2
3// Returns an ANSI Code for True Color, see:
4// https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
5// and look for 24-bit colors. Only looks good in supported terminals,
6// otherwise looks like FakeColor.
7const TrueColor = function (red, blue, green) {
8 return `\x1B[48;2;${Math.round(red)};${Math.round(green)};${Math.round(blue)}m`;
9};
10
11module.exports = TrueColor;