001/* Copyright (C) Cross The Road Electronics 2024 */ 002package com.ctre.phoenix.led; 003 004/** 005 * Animation that creates a rainbow throughout all the LEDs 006 */ 007public class RainbowAnimation extends BaseStandardAnimation { 008 /** 009 * Constructor for a RainbowAnimation 010 * @param brightness The brightness of the LEDs [0, 1] 011 * @param speed How fast the rainbow travels through the leds [0, 1] 012 * @param numLed How many LEDs are controlled by the CANdle 013 * @param reverseDirection True to reverse the animation direction, so instead of going "toward" the CANdle, it will go "away" from the CANdle. 014 * @param ledOffset Where to start the animation 015 */ 016 public RainbowAnimation(double brightness, double speed, int numLed, boolean reverseDirection, int ledOffset) { 017 super(0x60, brightness, speed, numLed, 0, 0, reverseDirection, ledOffset); 018 } 019 /** 020 * Constructor for a RainbowAnimation 021 * @param brightness The brightness of the LEDs [0, 1] 022 * @param speed How fast the rainbow travels through the leds [0, 1] 023 * @param numLed How many LEDs are controlled by the CANdle 024 */ 025 public RainbowAnimation(double brightness, double speed, int numLed) { 026 this(brightness, speed, numLed, false, 0); 027 } 028 /** 029 * Constructor for a RainbowAnimation 030 * Call the individual setters to tune the Rainbow animation further 031 */ 032 public RainbowAnimation() { 033 this(1, 1, -1, false, 0); 034 } 035}