Javascript String rgb(r, g, b)

Description

Javascript String rgb(r, g, b)


String.prototype.rgb = function (r, g, b) {
 return '\x1b[38;2;' + r + ';' + g + ';' + b + 'm' + this + '\x1b[0m';
};
String.prototype.rgbBG = function (r, g, b) {
 return '\x1b[48;2;' + r + ';' + g + ';' + b + 'm' + this + '\x1b[0m';
};



PreviousNext

Related