Echo.Sync
Color
Class Hierarchy:

Provides tools for rendering color properties.

Class Method Summary
Public adjust()
Adjusts the value of the color's RGB values by the specified amounts, returning a new Color.
Public blend()
Blends two colors together.
Public render()
Renders a color to an element.
Public renderClear()
Renders a color to an element, clearing any existing value.
Public renderFB()
Renders the "foreground" and "background" color properties of a component to an element's "color" and "backgroundColor" properties.
Public toHex()
Converts red/green/blue integer values to a 6 digit hexadecimal string, preceded by a sharp, e.

Class Method Detail
adjust
Adjusts the value of the color's RGB values by the specified amounts, returning a new Color. The original color is unchanged.
Parameters:
color - the color to adjust (a 24 bit hex value, e.g., #1a2b3c)
r - the amount to adjust the red value of the color (-255 to 255)
g - the amount to adjust the green value of the color (-255 to 255)
b - the amount to adjust the blue value of the color (-255 to 255)
Returns:
the adjusted color (a 24 bit hex value)

blend
Blends two colors together.
Parameters:
value1 (#Color) - the first color
value2 (#Color) - the second color
ratio (Number) - the blend ratio, where 0 represents the first color, 1 the second color, and 0.5 an equal blend between the first and second colors
Returns:
(#Color) the blended color

render
Renders a color to an element.
Parameters:
color (#Color) - the color
element (#Element) - the target element
styleAttribute (String) - the name of the style attribute, e.g., "color", "backgroundColor"

renderClear
Renders a color to an element, clearing any existing value.
Parameters:
color (#Color) - the color
element (#Element) - the target element
styleAttribute (String) - the name of the style attribute, e.g., "color", "backgroundColor"

renderFB
Renders the "foreground" and "background" color properties of a component to an element's "color" and "backgroundColor" properties.
Parameters:
component (Echo.Component) - the component
the (Element) - target element

toHex
Converts red/green/blue integer values to a 6 digit hexadecimal string, preceded by a sharp, e.g. #1a2b3c.
Parameters:
red (Number) - the red value, 0-255
green (Number) - the green value, 0-255
blue (Number) - the blue value, 0-255
Returns:
(String) the hex string