mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 20:53:39 +00:00
Update JSDoc on Display (object types)
This commit is contained in:
parent
876911fd32
commit
94d92910cb
6 changed files with 45 additions and 28 deletions
|
@ -81,7 +81,7 @@ var Color = new Class({
|
|||
* An array containing the calculated color values for WebGL use.
|
||||
*
|
||||
* @name Phaser.Display.Color#gl
|
||||
* @type {array}
|
||||
* @type {[number,number,number,number]}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
this.gl = [ 0, 0, 0, 1 ];
|
||||
|
@ -196,7 +196,7 @@ var Color = new Class({
|
|||
* @method Phaser.Display.Color#setFromRGB
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} color - An object containing `r`, `g`, `b` and optionally `a` values in the range 0 to 255.
|
||||
* @param {InputColorObject} color - An object containing `r`, `g`, `b` and optionally `a` values in the range 0 to 255.
|
||||
*
|
||||
* @return {Phaser.Display.Color} This Color object.
|
||||
*/
|
||||
|
@ -246,7 +246,7 @@ var Color = new Class({
|
|||
|
||||
/**
|
||||
* The color of this Color component, not including the alpha channel.
|
||||
*
|
||||
*
|
||||
* @name Phaser.Display.Color#color
|
||||
* @type {number}
|
||||
* @readOnly
|
||||
|
@ -263,7 +263,7 @@ var Color = new Class({
|
|||
|
||||
/**
|
||||
* The color of this Color component, including the alpha channel.
|
||||
*
|
||||
*
|
||||
* @name Phaser.Display.Color#color32
|
||||
* @type {number}
|
||||
* @readOnly
|
||||
|
@ -280,7 +280,7 @@ var Color = new Class({
|
|||
|
||||
/**
|
||||
* The color of this Color component as a string which can be used in CSS color values.
|
||||
*
|
||||
*
|
||||
* @name Phaser.Display.Color#rgba
|
||||
* @type {string}
|
||||
* @readOnly
|
||||
|
@ -297,7 +297,7 @@ var Color = new Class({
|
|||
|
||||
/**
|
||||
* The red color value, normalized to the range 0 to 1.
|
||||
*
|
||||
*
|
||||
* @name Phaser.Display.Color#redGL
|
||||
* @type {float}
|
||||
* @since 3.0.0
|
||||
|
@ -322,7 +322,7 @@ var Color = new Class({
|
|||
|
||||
/**
|
||||
* The green color value, normalized to the range 0 to 1.
|
||||
*
|
||||
*
|
||||
* @name Phaser.Display.Color#greenGL
|
||||
* @type {float}
|
||||
* @since 3.0.0
|
||||
|
@ -347,7 +347,7 @@ var Color = new Class({
|
|||
|
||||
/**
|
||||
* The blue color value, normalized to the range 0 to 1.
|
||||
*
|
||||
*
|
||||
* @name Phaser.Display.Color#blueGL
|
||||
* @type {float}
|
||||
* @since 3.0.0
|
||||
|
@ -372,7 +372,7 @@ var Color = new Class({
|
|||
|
||||
/**
|
||||
* The alpha color value, normalized to the range 0 to 1.
|
||||
*
|
||||
*
|
||||
* @name Phaser.Display.Color#alphaGL
|
||||
* @type {float}
|
||||
* @since 3.0.0
|
||||
|
@ -397,9 +397,9 @@ var Color = new Class({
|
|||
|
||||
/**
|
||||
* The red color value, normalized to the range 0 to 255.
|
||||
*
|
||||
*
|
||||
* @name Phaser.Display.Color#red
|
||||
* @type {float}
|
||||
* @type {number}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
red: {
|
||||
|
@ -424,9 +424,9 @@ var Color = new Class({
|
|||
|
||||
/**
|
||||
* The green color value, normalized to the range 0 to 255.
|
||||
*
|
||||
*
|
||||
* @name Phaser.Display.Color#green
|
||||
* @type {float}
|
||||
* @type {number}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
green: {
|
||||
|
@ -451,9 +451,9 @@ var Color = new Class({
|
|||
|
||||
/**
|
||||
* The blue color value, normalized to the range 0 to 255.
|
||||
*
|
||||
*
|
||||
* @name Phaser.Display.Color#blue
|
||||
* @type {float}
|
||||
* @type {number}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
blue: {
|
||||
|
@ -478,9 +478,9 @@ var Color = new Class({
|
|||
|
||||
/**
|
||||
* The alpha color value, normalized to the range 0 to 255.
|
||||
*
|
||||
*
|
||||
* @name Phaser.Display.Color#alpha
|
||||
* @type {float}
|
||||
* @type {number}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
alpha: {
|
||||
|
|
|
@ -4,14 +4,6 @@
|
|||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} ColorObject
|
||||
* @property {number} r - The red color value in the range 0 to 255.
|
||||
* @property {number} g - The green color value in the range 0 to 255.
|
||||
* @property {number} b - The blue color value in the range 0 to 255.
|
||||
* @property {number} a - The alpha color value in the range 0 to 255.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Converts the given color value into an Object containing r,g,b and a properties.
|
||||
*
|
||||
|
|
|
@ -12,7 +12,7 @@ var Color = require('./Color');
|
|||
* @function Phaser.Display.Color.ObjectToColor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} input - An object containing `r`, `g`, `b` and `a` properties in the range 0 to 255.
|
||||
* @param {InputColorObject} input - An object containing `r`, `g`, `b` and `a` properties in the range 0 to 255.
|
||||
*
|
||||
* @return {Phaser.Display.Color} A Color object.
|
||||
*/
|
||||
|
|
|
@ -4,6 +4,14 @@
|
|||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} HSLColorObject
|
||||
*
|
||||
* @property {number} h - The hue color value. A number between 0 and 1
|
||||
* @property {number} s - The saturation color value. A number between 0 and 1
|
||||
* @property {number} l - The lightness color value. A number between 0 and 1
|
||||
*/
|
||||
|
||||
/**
|
||||
* Converts an RGB color value to HSV (hue, saturation and value).
|
||||
* Conversion forumla from http://en.wikipedia.org/wiki/HSL_color_space.
|
||||
|
@ -17,7 +25,7 @@
|
|||
* @param {integer} g - The green color value. A number between 0 and 255.
|
||||
* @param {integer} b - The blue color value. A number between 0 and 255.
|
||||
*
|
||||
* @return {object} An object with the properties `h`, `s` and `v`.
|
||||
* @return {HSLColorObject} An object with the properties `h`, `s` and `v`.
|
||||
*/
|
||||
var RGBToHSV = function (r, g, b)
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@ var RGBStringToColor = require('./RGBStringToColor');
|
|||
* @function Phaser.Display.Color.ValueToColor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {string|number|object} input - The source color value to convert.
|
||||
* @param {string|number|InputColorObject} input - The source color value to convert.
|
||||
*
|
||||
* @return {Phaser.Display.Color} A Color object.
|
||||
*/
|
||||
|
|
|
@ -4,6 +4,23 @@
|
|||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} InputColorObject
|
||||
*
|
||||
* @property {number} [r] - The red color value in the range 0 to 255.
|
||||
* @property {number} [g] - The green color value in the range 0 to 255.
|
||||
* @property {number} [b] - The blue color value in the range 0 to 255.
|
||||
* @property {number} [a] - The alpha color value in the range 0 to 255.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} ColorObject
|
||||
* @property {number} r - The red color value in the range 0 to 255.
|
||||
* @property {number} g - The green color value in the range 0 to 255.
|
||||
* @property {number} b - The blue color value in the range 0 to 255.
|
||||
* @property {number} a - The alpha color value in the range 0 to 255.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @namespace Phaser.Display.Color
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue