<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The source code</title>
- <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
- <script type="text/javascript" src="../prettify/prettify.js"></script>
+ <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
<style type="text/css">
.highlight { display: block; background-color: #ddd; }
</style>
</head>
<body onload="prettyPrint(); highlight();">
<pre class="prettyprint lang-js"><span id='Ext-draw-Color'>/**
-</span> * @class Ext.draw.Color
- * @extends Object
- *
- * Represents an RGB color and provides helper functions get
+</span> * Represents an RGB color and provides helper functions get
* color components in HSL color space.
*/
Ext.define('Ext.draw.Color', {
lightnessFactor: 0.2,
<span id='Ext-draw-Color-method-constructor'> /**
-</span> * @constructor
+</span> * Creates new Color.
* @param {Number} red Red component (0..255)
* @param {Number} green Green component (0..255)
* @param {Number} blue Blue component (0..255)
<span id='Ext-draw-Color-method-getRGB'> /**
</span> * Get the RGB values.
- * @return {Array}
+ * @return {Number[]}
*/
getRGB: function() {
var me = this;
<span id='Ext-draw-Color-method-getHSL'> /**
</span> * Get the equivalent HSL components of the color.
- * @return {Array}
+ * @return {Number[]}
*/
getHSL: function() {
var me = this,
return ['#', r, g, b].join('');
},
-<span id='Ext-draw-Color-method-toHex'> /**
+<span id='Ext-draw-Color-static-method-toHex'> /**
</span> * Convert a color to hexadecimal format.
*
- * @param {String|Array} color The color value (i.e 'rgb(255, 255, 255)', 'color: #ffffff').
+ * **Note:** This method is both static and instance.
+ *
+ * @param {String/String[]} color The color value (i.e 'rgb(255, 255, 255)', 'color: #ffffff').
* Can also be an Array, in this case the function handles the first member.
* @returns {String} The color in hexadecimal format.
+ * @static
*/
toHex: function(color) {
if (Ext.isArray(color)) {
}
},
-<span id='Ext-draw-Color-method-fromString'> /**
+<span id='Ext-draw-Color-static-method-fromString'> /**
</span> * Parse the string and create a new color.
*
* Supported formats: '#rrggbb', '#rgb', and 'rgb(r,g,b)'.
*
* If the string is not recognized, an undefined will be returned instead.
*
+ * **Note:** This method is both static and instance.
+ *
* @param {String} str Color in string.
* @returns Ext.draw.Color
+ * @static
*/
fromString: function(str) {
var values, r, g, b,
return this.r * 0.3 + this.g * 0.59 + this.b * 0.11;
},
-<span id='Ext-draw-Color-method-fromHSL'> /**
+<span id='Ext-draw-Color-static-method-fromHSL'> /**
</span> * Create a new color based on the specified HSL values.
+ *
+ * **Note:** This method is both static and instance.
*
* @param {Number} h Hue component (0..359)
* @param {Number} s Saturation component (0..1)
* @param {Number} l Lightness component (0..1)
* @returns Ext.draw.Color
+ * @static
*/
fromHSL: function(h, s, l) {
var C, X, m, i, rgb = [],