new ColorHarmony()
A collection of methods useful for manipulating and comparing colors.
- 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.
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)
-
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.
-
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)
-
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)