src/js/Tinter.js
function(text, color=[255,255,255], colorBg=[0,0,0], style="reset") {
        // First check for raw RGB truecolor code... if the console scheme
        // supports this then no probs... but if not - we need to degrade appropriately.
        if(color.constructor === Array && colorBg.constructor === Array) {
            if(config.scheme === "16M") {
                return this._styleTruecolor(text, color, colorBg, style);
            } else {
                return this._degrade(text, color, colorBg, style);
            }
        } else {
            throw new Error("Unrecognized or malformed RGB array values.");
        }
    }
function(text, color=[255,255,255], colorBg=[0,0,0], style="reset") {
        // First check for raw RGB truecolor code... if the console scheme
        // supports this then no probs... but if not - we need to degrade appropriately.
        if(color.constructor === Array && colorBg.constructor === Array) {
            if(config.scheme === "16M") {
                return this._styleTruecolor(text, color, colorBg, style);
            } else {
                return this._degrade(text, color, colorBg, style);
            }
        } else {
            throw new Error("Unrecognized or malformed RGB array values.");
        }
    }
function ( text , color = [ 255 , 255 , 255 ] , colorBg = [ 0 , 0 , 0 ] , style = "reset" ) { // First check for raw RGB truecolor code... if the console scheme // supports this then no probs... but if not - we need to degrade appropriately. if ( color . constructor === Array && colorBg . constructor === Array ) { if ( config . scheme === "16M" ) { return this . _styleTruecolor ( text , color , colorBg , style ) ; } else { return this . _degrade ( text , color , colorBg , style ) ; } } else { throw new Error ( "Unrecognized or malformed RGB array values." ) ; } }
Marks the text string with multiple RGB colors and ANSI named style characteristics.
@param {string} text - the text string to be colorized and/or styled.
@param {Array} color - an RGB integer array representing the foreground color.
@param {Array} colorBg - an RGB integer array representing the foreground color.
@param {string} style - the name of the ANSI text style.
@returns {string} - the colorized/styled text string.
@static
Marks the text string with multiple RGB colors and ANSI named style characteristics .