@kcuf/mere-color
Version:
Mere color utils for generating, manipulation, a11y purposes.
13 lines (12 loc) • 321 B
JavaScript
import _clamp from 'lodash/clamp';
import _round from 'lodash/round';
/**
* Normalizes alpha value between `[0, 100]` with precision 1.
*/
export default function normalizeAlpha(n) {
if (n === undefined) {
return undefined;
}
return _clamp(_round(n, 1), 0, 100);
}
//# sourceMappingURL=normalize-alpha.js.map