index.js
function colorConvert( percentage, option, colorValue ) {
        var color    = require( 'color' );
        var newColor = color( colorValue.trim() );
        var newValue = '';

        switch ( option.trim() ) {
        case 'darken':
            newValue = newColor.darken( percentage ).hexString();
            break;

        case 'lighten':
            newValue = newColor.lighten( percentage ).hexString();
            break;

        case 'rgb':
            newValue = newColor.clearer( percentage ).rgbString();
            break;

        default:
            return '';
        }

        return newValue;
    }
function colorConvert( percentage, option, colorValue ) {
        var color    = require( 'color' );
        var newColor = color( colorValue.trim() );
        var newValue = '';

        switch ( option.trim() ) {
        case 'darken':
            newValue = newColor.darken( percentage ).hexString();
            break;

        case 'lighten':
            newValue = newColor.lighten( percentage ).hexString();
            break;

        case 'rgb':
            newValue = newColor.clearer( percentage ).rgbString();
            break;

        default:
            return '';
        }

        return newValue;
    }
function colorConvert ( percentage , option , colorValue ) { var color = require ( 'color' ) ; var newColor = color ( colorValue . trim ( ) ) ; var newValue = '' ; switch ( option . trim ( ) ) { case 'darken' : newValue = newColor . darken ( percentage ) . hexString ( ) ; break ; case 'lighten' : newValue = newColor . lighten ( percentage ) . hexString ( ) ; break ; case 'rgb' : newValue = newColor . clearer ( percentage ) . rgbString ( ) ; break ; default : return '' ; } return newValue ; }
Calls the Color.js library for the conversion
Calls the Color . js library for the conversion