Skip to content

Commit 8b8601b

Browse files
committed
Working through color docs
1 parent cb2891d commit 8b8601b

7 files changed

Lines changed: 53 additions & 1 deletion

File tree

src/display/color/ColorToRGBA.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* [description]
3+
*
4+
* @function Phaser.Display.Color.ColorToRGBA
5+
* @since 3.0.0
6+
*
7+
* @param {number} color - [description]
8+
*/
19
var ColorToRGBA = function (color)
210
{
311
var output = {

src/display/color/ComponentToHex.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
// Return a string containing a hex representation of the given color component.
22
// @param {integer} color - The color channel to get the hex value for, must be a value between 0 and 255.
33
// @return {string} A string of length 2 characters, i.e. 255 = ff, 100 = 64.
4+
/**
5+
* [description]
6+
*
7+
* @function Phaser.Display.Color.ComponentToHex
8+
* @since 3.0.0
9+
*
10+
* @param {integer} color - [description]
11+
*
12+
* @return {string} [description]
13+
*/
414
var ComponentToHex = function (color)
515
{
616
var hex = color.toString(16);

src/display/color/GetColor.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
/**
22
* Given 3 color values this will return an integer representation of it.
33
*/
4+
/**
5+
* [description]
6+
*
7+
* @function Phaser.Display.Color.GetColor
8+
* @since 3.0.0
9+
*
10+
* @param {number} red - [description]
11+
* @param {number} green - [description]
12+
* @param {number} blue - [description]
13+
*
14+
* @return {number} [description]
15+
*/
416
var GetColor = function (red, green, blue)
517
{
618
return red << 16 | green << 8 | blue;

src/display/color/GetColor32.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
/**
22
* Given an alpha and 3 color values this will return an integer representation of it.
33
*/
4+
/**
5+
* [description]
6+
*
7+
* @function Phaser.Display.Color.GetColor32
8+
* @since 3.0.0
9+
*
10+
* @param {number} red - [description]
11+
* @param {number} green - [description]
12+
* @param {number} blue - [description]
13+
* @param {number} alpha - [description]
14+
*
15+
* @return {number} [description]
16+
*/
417
var GetColor32 = function (red, green, blue, alpha)
518
{
619
return alpha << 24 | red << 16 | green << 8 | blue;

src/display/color/HexStringToColor.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ var Color = require('./Color');
77
*
88
* An alpha channel is _not_ supported.
99
*/
10+
/**
11+
* [description]
12+
*
13+
* @function Phaser.Display.Color.HexStringToColor
14+
* @since 3.0.0
15+
*
16+
* @param {string} hex - [description]
17+
*
18+
* @return {Phaser.Color} [description]
19+
*/
1020
var HexStringToColor = function (hex)
1121
{
1222
var color = new Color();

src/display/color/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ var Color = require('./Color');
44

55
Color.ColorToRGBA = require('./ColorToRGBA');
66
Color.ComponentToHex = require('./ComponentToHex');
7-
Color.CSSToColor = require('./CSSToColor');
87
Color.GetColor = require('./GetColor');
98
Color.GetColor32 = require('./GetColor32');
109
Color.HexStringToColor = require('./HexStringToColor');

0 commit comments

Comments
 (0)