You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
1.9 KiB

import{i as e}from"./competitionBranding-BjQScvy4.js";var t=`#109bd3`,n=`#087db4`,r=`#e8f6fc`,i=`#f4fbfe`,a=`#cfe8f3`;function o(e){return Math.max(0,Math.min(255,Math.round(e)))}function s(e){let t=e.trim().replace(`#`,``);return/^[0-9a-f]{6}$/i.test(t)?`${parseInt(t.slice(0,2),16)}, ${parseInt(t.slice(2,4),16)}, ${parseInt(t.slice(4,6),16)}`:null}function c(e,t=.82){let n=s(e);if(!n)return e;let[r,i,a]=n.split(`,`).map(e=>o(Number(e)*t));return`#${[r,i,a].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function l(e,t){let n=s(e);if(!n)return e;let[r,i,a]=n.split(`,`).map(Number);return`#${[o(r+(255-r)*t),o(i+(255-i)*t),o(a+(255-a)*t)].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function u(n){let r=n?.trim()??``;return e(r)?/^(?:#|rgb|hsl)/i.test(r)?r:`#${r.replace(/^#/,``)}`:t}function d(e){if(typeof document>`u`)return;let o=u(e),d=o.toLowerCase()===t,f=d||!o.startsWith(`#`)?n:c(o),p=d||!o.startsWith(`#`)?r:l(o,.88),m=d||!o.startsWith(`#`)?i:l(o,.94),h=d||!o.startsWith(`#`)?a:l(o,.72),g=o.startsWith(`#`)?s(o):null;document.body.style.setProperty(`--primary`,o),document.body.style.setProperty(`--primary-dark`,f),document.body.style.setProperty(`--primary-soft`,p),document.body.style.setProperty(`--primary-pale`,m),document.body.style.setProperty(`--primary-line`,h),document.body.style.setProperty(`--bs-primary`,o),document.body.style.setProperty(`--el-color-primary`,o),document.body.style.setProperty(`--el-color-primary-dark-2`,f),g?(document.body.style.setProperty(`--bs-primary-rgb`,g),document.body.style.setProperty(`--hsxt-primary-rgb`,g)):(document.body.style.removeProperty(`--bs-primary-rgb`),document.body.style.removeProperty(`--hsxt-primary-rgb`))}function f(){if(!(typeof document>`u`))for(let e of[`--primary`,`--primary-dark`,`--primary-soft`,`--primary-pale`,`--primary-line`,`--bs-primary`,`--bs-primary-rgb`,`--el-color-primary`,`--el-color-primary-dark-2`,`--hsxt-primary-rgb`])document.body.style.removeProperty(e)}export{f as n,d as t};