X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/7a654f8d43fdb43d78b63d90528bed6e86b608cc..refs/heads/master:/docs/source/Color2.html diff --git a/docs/source/Color2.html b/docs/source/Color2.html index beaa2d6d..bc6fa6d8 100644 --- a/docs/source/Color2.html +++ b/docs/source/Color2.html @@ -1,8 +1,22 @@ -
+ +/** - * @class Ext.draw.Color - * @extends Object - * - * Represents an RGB color and provides helper functions get + + + + +\ No newline at end of file +The source code + + + + + + +/** + * Represents an RGB color and provides helper functions get * color components in HSL color space. */ Ext.define('Ext.draw.Color', { @@ -15,15 +29,15 @@ Ext.define('Ext.draw.Color', { rgbRe: /\s*rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)\s*/, hexRe: /\s*#([0-9a-fA-F][0-9a-fA-F]?)([0-9a-fA-F][0-9a-fA-F]?)([0-9a-fA-F][0-9a-fA-F]?)\s*/, - /** + /** * @cfg {Number} lightnessFactor * * The default factor to compute the lighter or darker color. Defaults to 0.2. */ lightnessFactor: 0.2, - /** - * @constructor + /** + * Creates new Color. * @param {Number} red Red component (0..255) * @param {Number} green Green component (0..255) * @param {Number} blue Blue component (0..255) @@ -36,7 +50,7 @@ Ext.define('Ext.draw.Color', { me.b = clamp(blue, 0, 255); }, - /** + /** * Get the red component of the color, in the range 0..255. * @return {Number} */ @@ -44,7 +58,7 @@ Ext.define('Ext.draw.Color', { return this.r; }, - /** + /** * Get the green component of the color, in the range 0..255. * @return {Number} */ @@ -52,7 +66,7 @@ Ext.define('Ext.draw.Color', { return this.g; }, - /** + /** * Get the blue component of the color, in the range 0..255. * @return {Number} */ @@ -60,18 +74,18 @@ Ext.define('Ext.draw.Color', { return this.b; }, - /** + /** * Get the RGB values. - * @return {Array} + * @return {Number[]} */ getRGB: function() { var me = this; return [me.r, me.g, me.b]; }, - /** + /** * Get the equivalent HSL components of the color. - * @return {Array} + * @return {Number[]} */ getHSL: function() { var me = this, @@ -105,7 +119,7 @@ Ext.define('Ext.draw.Color', { return [h, s, l]; }, - /** + /** * Return a new color that is lighter than this color. * @param {Number} factor Lighter factor (0..1), default to 0.2 * @return Ext.draw.Color @@ -117,7 +131,7 @@ Ext.define('Ext.draw.Color', { return this.fromHSL(hsl[0], hsl[1], hsl[2]); }, - /** + /** * Return a new color that is darker than this color. * @param {Number} factor Darker factor (0..1), default to 0.2 * @return Ext.draw.Color @@ -127,7 +141,7 @@ Ext.define('Ext.draw.Color', { return this.getLighter(-factor); }, - /** + /** * Return the color in the hex format, i.e. '#rrggbb'. * @return {String} */ @@ -143,12 +157,15 @@ Ext.define('Ext.draw.Color', { return ['#', r, g, b].join(''); }, - /** + /** * 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)) { @@ -174,15 +191,18 @@ Ext.define('Ext.draw.Color', { } }, - /** + /** * 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, @@ -213,7 +233,7 @@ Ext.define('Ext.draw.Color', { return (typeof r == 'undefined') ? undefined : Ext.create('Ext.draw.Color', r, g, b); }, - /** + /** * Returns the gray value (0 to 255) of the color. * * The gray value is calculated using the formula r*0.3 + g*0.59 + b*0.11. @@ -225,13 +245,16 @@ Ext.define('Ext.draw.Color', { return this.r * 0.3 + this.g * 0.59 + this.b * 0.11; }, - /** + /** * 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 = [], @@ -291,4 +314,6 @@ Ext.define('Ext.draw.Color', { } }); }); -