mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 09:31:20 -04:00
hue my oiter
This commit is contained in:
@@ -570,12 +570,12 @@ function buildSegments({ count, totalSpan, gap, startAngle }) {
|
||||
return segments;
|
||||
}
|
||||
|
||||
const LIGHT_BUMP_MAX = 2000; // easy sensitivity tuning for light bumps
|
||||
const LIGHT_BUMP_SENSITIVITY = 0.18; // increase to spin through hues faster
|
||||
function lightBumpColor(value) {
|
||||
if (value == null || value <= 0) return '#000000';
|
||||
const t = clamp01(value / LIGHT_BUMP_MAX);
|
||||
const hue = 140 - t * 80; // greenish toward amber
|
||||
const lightness = 15 + t * 55;
|
||||
const hue = (value * LIGHT_BUMP_SENSITIVITY) % 360; // cycles through the whole spectrum
|
||||
const t = clamp01(value / 3000); // controls lightness only
|
||||
const lightness = 20 + t * 50;
|
||||
return `hsl(${hue} 90% ${lightness}%)`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user