#![no_std]

extern crate alloc;

use alloc::vec;
use alloc::vec::Vec;
use bincode::{config, Decode, Encode};

#[derive(Copy, Clone, Encode, Decode, PartialEq, Debug)]
pub struct Led {
    pub r: u8,
    pub g: u8,
    pub b: u8,
}

#[derive(Clone, Encode, Decode, PartialEq, Debug)]
pub struct LedStrip {
    pub leds: Vec<Led>,
}

impl LedStrip {
    // naive inital start with uniform colour on entire strip
    pub fn new(size: usize, r: u8, g: u8, b: u8) -> LedStrip {
        let led_vec = vec![Led { r, g, b }; size];

        // for i in 0..99 {
        //     led_vec[i] = Led{ r: i as u8 + 2, g: i as u8 + 13, b: i as u8 + 33 };
        // }

        LedStrip { leds: led_vec }
    }
}
