Skip to content
Reference > Methods

colorCycle(offset)

Definition

String colorCycle(Number offset)

Description

Returns the nth color from choices where n is the offset + 1. If the offset is greater than or equal to the number of choices, n is calculated as (offset % number of choices) + 1.

Parameter Definition

Name Type Description
offset Number index into choices

Examples

1
2
3
String r1 = colorCycle(0); // r1 == #011aff
String r2 = colorCycle(5); // r2 == #873d00
String r3 = colorCycle(-1); // r3 == #85682f