NoveltyML reference > Object traits > AnimateColor

<AnimateColor>

Change between two or more colors over time.


Attributes

Attribute Description
from Initial color value
to Target color value
interval Length of animation
offset Offset of animation
mode Animation mode
reverse Reversing animation?
preview Preview in editor?


from [color]

Initial color value. Default is white.

Example:
from = "blue"


to [color]

Target color value. Default is white.

Example:
to = "purple"


interval [float]

Length of animation in seconds. Default is 1 second.

Example:
interval = "5"


offset [float]

Animation offset in seconds.

Example:
offset = "0.5"


mode [string]

Sets the animation mode. Determines how the animated value is calculated. Default is "linear"

Value Mode
"linear" Linear interpolation
"curve" Sine curve
"sqrt" Square root
"squared" Squared

Example:
mode = "curve"


reverse [bool]

When set to true, the animation will "bounce back" and play backwards during the second half of the animation.

Example:
reverse = "true"


preview [bool]

When set to true, this trait will animate in the Novelty editor. Default is false.

Example:
preview = "true"


Valid child tags

Tag Description
<Stop> Color animation stop


<Stop>

Adds a color stop to the animation. Using stops will override the from and to attributes.

Attribute Description Type
color Color value Color

Example:
<Stop color="blue"/>


Example

// Animation with just two colors 
<Traits>
	<AnimateColor interval="2" from="#FF00CC" to="Navy" />
</Traits>

// Animation with more than two colors 
<Traits>
	<AnimateColor interval="2">
		<Stop color="#FF00CC" />
		<Stop color="Navy" />
		<Stop color="White" />
	</AnimateColor>
</Traits>

Back to top