diff --git a/src/rgb_controller/effects.rs b/src/rgb_controller/effects.rs index b6f45de..fa27cf3 100644 --- a/src/rgb_controller/effects.rs +++ b/src/rgb_controller/effects.rs @@ -54,4 +54,30 @@ impl Effects { StaticPerKey => 20, } } + + pub fn from_u8(n: u8) -> Option { + match n { + 1 => Some(Static), + 2 => Some(SingleOn), + 3 => Some(SingleOff), + 4 => Some(Glittering), + 5 => Some(Rain), + 6 => Some(Colorful), + 7 => Some(Breath), + 8 => Some(Spectrum), + 9 => Some(CentrifugalWave), + 10 => Some(VerticalWave), + 11 => Some(HorizontalWave), + 12 => Some(Rotating), + 13 => Some(Explosion), + 14 => Some(Launch), + 15 => Some(Ripples), + 16 => Some(Snake), + 17 => Some(Pulse), + 18 => Some(Tilt), + 19 => Some(Shuttle), + 20 => Some(StaticPerKey), + _ => None + } + } }