colour.js
function addProperty(col, func) {
        // Exposed on top of the namespace
        colour[col] = function(str) {
            return func.apply(str);
        };
        // And on top of all strings
        try {
            String.prototype.__defineGetter__(col, func);
            definedGetters[col] = func;
        } catch (e) {} // #25
    }
function addProperty(col, func) {
        // Exposed on top of the namespace
        colour[col] = function(str) {
            return func.apply(str);
        };
        // And on top of all strings
        try {
            String.prototype.__defineGetter__(col, func);
            definedGetters[col] = func;
        } catch (e) {} // #25
    }
function addProperty ( col , func ) { // Exposed on top of the namespace colour [ col ] = function ( str ) { return func . apply ( str ) ; } ; // And on top of all strings try { String . prototype . __defineGetter__ ( col , func ) ; definedGetters [ col ] = func ; } catch ( e ) { } // #25 }
Prototypes the string object to have additional properties that wraps the current string in colours when accessed.
@param {string} col Colour / property name
@param {function(string):string} func Wrapper function
@private
Prototypes the string object to have additional properties that wraps the current string in colours when accessed .