Phaser.Plugin.ColorHarmony

new ColorHarmony()

A collection of methods useful for manipulating and comparing colors.

Author: - Richard Davey

Copyright: - 2013 Photon Storm Ltd.

License: - https://github.com/photonstorm/phaser/blob/master/license.txt MIT License

Source - out/plugins/ColorHarmony/ColorHarmony.js, line 11

Methods

getAnalogousHarmony(color, threshold)→ {Object}

Returns an Analogous Color Harmony for the given color.

An Analogous harmony are hues adjacent to each other on the color wheel

Values returned in 0xAARRGGBB format with Alpha set to 255.

Name

Type

Description

color

Number

The color to base the harmony on.

threshold

Number

Control how adjacent the colors will be (default +- 30 degrees)

Object-

Object containing 3 properties: color1 (the original color), color2 (thewarmer analogous color) and color3 (the colder analogous color)

Source - out/plugins/ColorHarmony/ColorHarmony.js, line 30

getComplementHarmony(color)→ {Number}

Returns a Complementary Color Harmony for the given color.

A complementary hue is one directly opposite the color given on the color wheel

Value returned in 0xAARRGGBB format with Alpha set to 255.

Name

Type

Description

color

Number

The color to base the harmony on.

Number-

0xAARRGGBB format color value.

Source - out/plugins/ColorHarmony/ColorHarmony.js, line 13

getSplitComplementHarmony(color, threshold)→ {Object}

Returns an Split Complement Color Harmony for the given color.

A Split Complement harmony are the two hues on either side of the color's Complement

Values returned in 0xAARRGGBB format with Alpha set to 255.

Name

Type

Description

color

Number

The color to base the harmony on

threshold

Number

Control how adjacent the colors will be to the Complement (default +- 30degrees)

Object-

An object containing 3 properties: color1 (the original color), color2 (the warmer analogous color) and color3 (the colder analogous color)

Source - out/plugins/ColorHarmony/ColorHarmony.js, line 58

getTriadicHarmony(color)→ {Object}

Returns a Triadic Color Harmony for the given color.

A Triadic harmony are 3 hues equidistant from each other on the color wheel

Values returned in 0xAARRGGBB format with Alpha set to 255.

Name

Type

Description

color

Number

The color to base the harmony on.

Object-

An Object containing 3 properties: color1 (the original color), color2 and color3 (the equidistant colors)

Source - out/plugins/ColorHarmony/ColorHarmony.js, line 87