Phaser.Plugin. ColorHarmony

new ColorHarmony()

A collection of methods useful for manipulating and comparing colors.

Author:
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.

Parameters:
Name Type Description
color Number

The color to base the harmony on.

threshold Number

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

Returns:
Object -

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 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.

Parameters:
Name Type Description
color Number

The color to base the harmony on.

Returns:
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.

Parameters:
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 +- 30 degrees)

Returns:
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.

Parameters:
Name Type Description
color Number

The color to base the harmony on.

Returns:
Object -

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

Source - out/plugins/ColorHarmony/ColorHarmony.js, line 87
Phaser Copyright © 2012-2016 Photon Storm Ltd.
Documentation generated by JSDoc 3.4.3 on Thu Apr 13 2017 12:05:12 GMT-0700 (PDT) using the DocStrap template.