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 *
007 * @deprecated This device's Phoenix 5 API is deprecated for removal in the
008 * 2027 season. Users should update to Phoenix 6 firmware and migrate to the
009 * Phoenix 6 API. A migration guide is available at
010 * https://v6.docs.ctr-electronics.com/en/stable/docs/migration/migration-guide/index.html.
011 * <p>
012 * If the Phoenix 5 API must be used for this device, the device must have 22.X
013 * firmware. This firmware is available in Tuner X after selecting Phoenix 5 in
014 * the firmware year dropdown.
015 */
016@Deprecated(since = "2026", forRemoval = true)
017public class RainbowAnimation extends BaseStandardAnimation {
018    /**
019     * Constructor for a RainbowAnimation
020     * @param brightness The brightness of the LEDs [0, 1]
021     * @param speed How fast the rainbow travels through the leds [0, 1]
022     * @param numLed How many LEDs are controlled by the CANdle
023     * @param reverseDirection True to reverse the animation direction, so instead of going "toward" the CANdle, it will go "away" from the CANdle.
024     * @param ledOffset Where to start the animation
025     */
026    public RainbowAnimation(double brightness, double speed, int numLed, boolean reverseDirection, int ledOffset) {
027        super(0x60, brightness, speed, numLed, 0, 0, reverseDirection, ledOffset);
028    }
029    /**
030     * Constructor for a RainbowAnimation
031     * @param brightness The brightness of the LEDs [0, 1]
032     * @param speed How fast the rainbow travels through the leds [0, 1]
033     * @param numLed How many LEDs are controlled by the CANdle
034     */
035    public RainbowAnimation(double brightness, double speed, int numLed) {
036        this(brightness, speed, numLed, false, 0);
037    }
038    /**
039     * Constructor for a RainbowAnimation
040     * Call the individual setters to tune the Rainbow animation further
041     */
042    public RainbowAnimation() {
043        this(1, 1, -1, false, 0);
044    }
045}