@rickosborne/rebound
Version:
Rick Osborne's utilities for working with bounded numbers
19 lines (18 loc) • 598 B
JavaScript
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
import { isInt } from "@rickosborne/guard";
import { int255 } from "./int255.mjs";
import { real01 } from "./real01.mjs";
import { real255 } from "./real255.mjs";
function real01From255(value) {
if (value == null) {
return void 0;
}
const range = isInt(value) ? int255.range : real255.range;
return real01.range.scaleValueFrom(value, range);
}
__name(real01From255, "real01From255");
export {
real01From255
};
//# sourceMappingURL=real01-from-255.mjs.map