@aurigma/design-atoms
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
11 lines • 356 B
JavaScript
import { mapToRange } from "../../Utils/Math";
export function convertRelativeToByte(value) {
return toInt(mapToRange(value, 0, 1, 0, 255));
}
export function convertPercentToByte(value) {
return toInt(mapToRange(value, 0, 100, 0, 255));
}
function toInt(value) {
return parseInt(value.toFixed(0));
}
//# sourceMappingURL=Utils.js.map