@atlaskit/adf-schema
Version:
Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs
21 lines (20 loc) • 439 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.labToLch = void 0;
var labToLch = exports.labToLch = function labToLch(_ref) {
var l = _ref.l,
a = _ref.a,
b = _ref.b;
var h = (Math.atan2(b, a) * (180 / Math.PI) + 360) % 360;
var c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));
if (Math.round(c * 10000) === 0) {
h = Number.NaN;
}
return {
l: l,
c: c,
h: h
};
};