Completed picker / history. Needs styling refactor.

This commit is contained in:
Jay
2025-08-16 09:10:20 -04:00
parent 7a2e4cf2ae
commit c4ece87cb6
23 changed files with 873 additions and 79 deletions
+13 -2
View File
@@ -92,9 +92,20 @@ export function chooseValueByDirection(
return direction === Direction.HORIZONTAL ? xValue : yValue;
}
export function roundTo(value: number, decimals: number = 0) {
export function roundTo(
value: number,
decimals: number = 0,
direction: "up" | "down" | null = null,
) {
const factor = Math.pow(10, decimals);
return Math.round(value * factor) / factor;
switch (direction) {
case "up":
return Math.ceil(value * factor) / factor;
case "down":
return Math.floor(value * factor) / factor;
default:
return Math.round(value * factor) / factor;
}
}
export function formatCssRgb(hex: Hex) {