Functiondojo.colorFromString

<script src="../../js/dojo.js"></script>
defined in dojo/_base/Color.js

Acceptable input values for str may include arrays of any form accepted by dojo.colorFromArray, hex strings such as "#aaaaaa", or rgb or rgba strings such as "rgb(133, 200, 16)" or "rgba(10, 10, 10, 50)"

Usage

function (/*String*/ str, /*dojo.Color?*/ obj) (view source)
parametertypedescription
strString 
objdojo.ColorOptional. 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
fieldtypedescription
.r 
.sanitizeFunctionmakes sure that the object has correct attributes
.setColorFunctiontakes 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
.toCssFunctionreturns a css color string in rgb(a) representation
.toHexFunctionreturns a css color string in hexadecimal representation
.toRgbFunctionreturns 3 component array of rgb values
.toRgbaFunctionreturns a 4 component array of rgba values
.toStringFunctionreturns a visual representation of the color
._setFunction