JSAPI.info

dojo.Color

Dojo (1.6.1) - see full source
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
dojo.Color = function(/*Array|String|Object*/ color){
    // summary:
    //         Takes a named string, hex string, array of rgb or rgba values,
    //         an object with r, g, b, and a properties, or another `dojo.Color` object
    //         and creates a new Color instance to work from.
    //
    // example:
    //        Work with a Color instance:
    //     | var c = new dojo.Color();
    //     | c.setColor([0,0,0]); // black
    //     | var hex = c.toHex(); // #000000
    //
    // example:
    //        Work with a node's color:
    //     | var color = dojo.style("someNode", "backgroundColor");
    //     | var n = new dojo.Color(color);
    //     | // adjust the color some
    //     | n.r *= .5;
    //     | console.log(n.toString()); // rgb(128, 255, 255);
    if(color){ this.setColor(color); }
};