added from_u8 to effects enum
This commit is contained in:
1 file changed
+26
@@ -54,4 +54,30 @@ impl Effects {
|
||||
StaticPerKey => 20,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_u8(n: u8) -> Option<Self> {
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user