Color.Harmony Class
Color Harmony provides methods useful for color combination discovery.
Index
Methods
Properties
Methods
_adjustOffsetAndFinish
                                                
                                                        - 
                                                                        
color - 
                                                                        
offsets - 
                                                                        
to 
Takes an HSL array, and an array of offsets and returns and array of colors that have been adjusted. The returned colors will match the array of offsets provided. If you wish you have the same color value returned, you can provide null or an empty object to the offsets. The returned array will contain color value strings that have been adjusted from subtractive to additive.
Parameters:
- 
                                                                        
colorArray - 
                                                                        
offsetsArray - 
                                                                        
toString 
Returns:
_constrainHue
                                                
                                                        - 
                                                                        
hue - 
                                                                        
[precision] 
Contrain the hue to a value between 0 and 360 for calculations and real color wheel value space. Provide a precision value to round return value to a decimal place
Returns:
Constrained hue value
_finish
                                                
                                                        - 
                                                                        
hsla - 
                                                                        
[to] 
Converts the provided HSLA values from subtractive to additive returning a converted color string
Parameters:
- 
                                                                        
hslaArray - 
                                                                        
[to]String optional 
Returns:
_searchLuminanceForBrightness
                                                
                                                        - 
                                                                        
color - 
                                                                        
brightness - 
                                                                        
min - 
                                                                        
max 
Calculates the luminance as a mid range between the min and max to match the brightness level provided
Parameters:
Returns:
Found luminance to achieve requested brightness
_start
                                                
                                                        - 
                                                                        
str 
Converts the provided color from additive to subtractive returning an Array of HSLA values
Parameters:
- 
                                                                        
strString 
Returns:
_toAdditive
                                                
                                                        - 
                                                                        
hue 
Adjusts the hue degree from subtractive to additive
Parameters:
- 
                                                                        
hueNumber 
Returns:
Converted additive hue
_toSubtractive
                                                
                                                        - 
                                                                        
hue 
Adjusts the hue degree from additive to subtractive
Parameters:
- 
                                                                        
hueNumber 
Returns:
Converted subtractive hue
getAnalogous
                                                
                                                        - 
                                                                        
str - 
                                                                        
[offset] - 
                                                                        
[to] 
Returns an Array of five colors. The first color in the Array will be the color passed in. The remaining four will be analogous colors two in either direction from the initially provided color.
Parameters:
- 
                                                                        
strString - 
                                                                        
[offset]Number optional - 
                                                                        
[to]String optional 
Returns:
getBrightness
                                                
                                                        - 
                                                                        
str 
Returns 0 - 100 percentage of brightness from 0 (black) being the
                                                darkest to 100 (white) being the brightest.
Parameters:
- 
                                                                        
strString 
Returns:
getComplementary
                                                
                                                        - 
                                                                        
str - 
                                                                        
[to] 
Returns an Array of two colors. The first color in the Array will be the color passed in. The second will be the complementary color of the color provided
Parameters:
- 
                                                                        
strString - 
                                                                        
[to]String optional 
Returns:
getMonochrome
                                                
                                                        - 
                                                                        
str - 
                                                                        
[count] - 
                                                                        
[to] 
Calculates lightness offsets resulting in a monochromatic Array of values.
Parameters:
- 
                                                                        
strString - 
                                                                        
[count]Number optional - 
                                                                        
[to]String optional 
Returns:
getOffset
                                                
                                                        - 
                                                                        
str - 
                                                                        
adjust - 
                                                                        
[to] 
Adjusts the provided color by the offset(s) given. You may adjust hue, saturation, and/or luminance in one step.
Parameters:
Returns:
getSimilar
                                                
                                                        - 
                                                                        
str - 
                                                                        
[offset] - 
                                                                        
[count] - 
                                                                        
[to] 
Creates an Array of similar colors. Returned Array is prepended with the color provided followed a number of colors decided by count
Returns:
getSimilarBrightness
                                                
                                                        - 
                                                                        
str - 
                                                                        
match - 
                                                                        
[to] 
Returns a new color value with adjusted luminance so that the
                                                brightness of the return color matches the perceived brightness
                                                of the match color provided.
Parameters:
- 
                                                                        
strString - 
                                                                        
matchString - 
                                                                        
[to]String optional 
Returns:
getSplit
                                                
                                                        - 
                                                                        
str - 
                                                                        
[offset] - 
                                                                        
[to] 
Returns an Array of three colors. The first color in the Array will be the color passed in. The second two will be split complementary colors.
Parameters:
- 
                                                                        
strString - 
                                                                        
[offset]Number optional - 
                                                                        
[to]String optional 
Returns:
getSquare
                                                
                                                        - 
                                                                        
str - 
                                                                        
[to] 
Returns an Array of four colors. The first color in the Array will be the color passed in. The remaining three colors are equidistant offsets from the starting color and each other.
Parameters:
- 
                                                                        
strString - 
                                                                        
[to]String optional 
Returns:
getTetrad
                                                
                                                        - 
                                                                        
str - 
                                                                        
[offset] - 
                                                                        
[to] 
Returns an Array of four colors. The first color in the Array will be the color passed in. The remaining three colors are equidistant offsets from the starting color and each other.
Parameters:
- 
                                                                        
strString - 
                                                                        
[offset]Number optional - 
                                                                        
[to]String optional 
Returns:
getTriad
                                                
                                                        - 
                                                                        
str - 
                                                                        
[to] 
Returns an Array of three colors. The first color in the Array will be the color passed in. The second two will be equidistant from the start color and each other.
Parameters:
- 
                                                                        
strString - 
                                                                        
[to]String optional 
Returns:
Properties
_brightnessWeights
                                                    Unknown
                                                
                                                
                                                        private
                                                
                                                
                                                
                                                    
                                                
                                                    Brightness weight factors for perceived brightness calculations
"standard" values are listed as R: 0.241, G: 0.691, B: 0.068 These values were changed based on grey scale comparison of hsl to new hsl where brightness is said to be within plus or minus 0.01.