strobe: choose color by wheel parameter
This commit is contained in:
parent
67d7afbd78
commit
efe7ade906
1 changed files with 11 additions and 5 deletions
|
@ -28,11 +28,17 @@ impl ColorGrid for Strobe {
|
||||||
fn get(&self, p: &Vector2<f32>) -> Rgb<f32> {
|
fn get(&self, p: &Vector2<f32>) -> Rgb<f32> {
|
||||||
let t = (self.inputs.wheel as f32 * self.inputs.t.as_millis() as f32 / self.inputs.cycle_len.as_millis() as f32) % 1.0;
|
let t = (self.inputs.wheel as f32 * self.inputs.t.as_millis() as f32 / self.inputs.cycle_len.as_millis() as f32) % 1.0;
|
||||||
|
|
||||||
if t < 0.6 {
|
Rgb::from_color(
|
||||||
Rgb::new(0.3, 0.3, 0.3)
|
&Hsv::<f32, Turns<f32>>::new(
|
||||||
} else {
|
Turns( (self.inputs.wheel.abs() % 256) as f32 / 256.0 ),
|
||||||
Rgb::new(0.05, 0.05, 0.05)
|
0.9,
|
||||||
}
|
if t < 0.6 {
|
||||||
|
0.3
|
||||||
|
} else {
|
||||||
|
1.0
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue