diff --git a/src/filters.rs b/src/filters.rs index 9a18af2..7596677 100644 --- a/src/filters.rs +++ b/src/filters.rs @@ -23,6 +23,10 @@ impl PassThroughFilter { PassThroughFilter::Rotating(filter_angle) => { let mut hsla = color.as_hsla_f32(); hsla[0] = (hsla[0] + filter_angle) % 360.; + // floating rem is not modulo! + if hsla[0] < 0. { + hsla[0] += 360.; + } Color::hsla(hsla[0], hsla[1], hsla[2], hsla[3]) } }