"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../../../../../../../chroma-js@2.4.2/node_modules/chroma-js/chroma.js"),u=require("./manipulation.js"),y=require("../theme/utils.js");function s(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?s=function(o){return typeof o}:s=function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},s(i)}var m=function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4.85;return function(n){var c,l=s(n)==="object"&&(c=y.getOn(n,e))!==null&&c!==void 0?c:e,r=s(n)==="object"?n.colors.body:n;(a(l).alpha()<1||a(r).alpha()<1)&&console.warn(`Contrast cannot be accurately calculated when colors have alpha channel opacity. Make sure the provided foreground and background colors have no transparency:

Foreground: `.concat(l,`
Background: `).concat(r));for(var d=a.contrast(l,r),h=u.lightness(r),t=l;d<o;){h>50?t=u.shade(t,.05):t=u.tint(t,.05),d=a.contrast(t,r);var f=u.lightness(t);if(f<5)return console.warn("High enough contrast could not be determined. Most likely your background color does not adjust for light mode."),t;if(f>95)return console.warn("High enough contrast could not be determined. Most likely your background color does not adjust for dark mode."),t}return a(t).hex()}},g=function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return function(n){return m(e,o)(n)}};exports.makeDisabledContrastColor=g;exports.makeHighContrastColor=m;
//# sourceMappingURL=contrast.js.map
