PageSourceSearch

https://www.teamhiiv.com/assets/brand-resolver-BDMIUi4H.js

js teamhiiv.com collected 2026-10-04 05:38:46 UTC 2,247 bytes, 1 lines download raw bytes

1const C="#2563EB",x="#475569",O="#F59E0B",T="#FFFFFF",g="Calibri";function M(t){return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function p(t){const o=M(parseInt(t.slice(1,3),16)/255),n=M(parseInt(t.slice(3,5),16)/255),a=M(parseInt(t.slice(5,7),16)/255);return .2126*o+.7152*n+.0722*a}function E(t,o){const n=p(t.toUpperCase()),a=p(o.toUpperCase()),s=Math.max(n,a),c=Math.min(n,a);return(s+.05)/(c+.05)}function u(t,o=4.5){const n="#FFFFFF";return E(n,t)>=o?n:"#1A1A2E"}function D(t){const o=["#6B7280","#9CA3AF","#4B5563","#D1D5DB"];for(const n of o)if(E(n,t)>=3)return n;return u(t,3)}function F(t){const o=parseInt(t.slice(1,3),16)/255,n=parseInt(t.slice(3,5),16)/255,a=parseInt(t.slice(5,7),16)/255,s=Math.max(o,n,a),c=Math.min(o,n,a),i=(s+c)/2;if(s===c)return[0,0,i];const e=s-c,r=i>.5?e/(2-s-c):e/(s+c);let h=0;return s===o?h=((n-a)/e+(n<a?6:0))/6:s===n?h=((a-o)/e+2)/6:h=((o-n)/e+4)/6,[h*360,r,i]}function m(t,o,n){const a=(t%360+360)%360,s=Math.max(0,Math.min(1,o)),c=Math.max(0,Math.min(1,n)),i=s*Math.min(c,1-c),e=r=>{const h=(r+a/30)%12,l=c-i*Math.max(Math.min(h-3,9-h,1),-1);return Math.round(255*Math.max(0,Math.min(1,l))).toString(16).padStart(2,"0")};return`#${e(0)}${e(8)}${e(4)}`.toUpperCase()}function _(t,o,n=3){const[a,s,c]=F(t),e=p(o)<.2;for(let r=0;r<=.5;r+=.05){const h=e?Math.min(1,c+r):Math.max(0,c-r),l=m(a,s,h);if(E(l,o)>=n)return l}return e?"#FFFFFF":"#1A1A2E"}function B(t,o,n,a){const[s,c,i]=F(t),[e,r,h]=F(o),[l,d,A]=F(n),S=(c+r+d)/3,f=S<.1?.15-S:0;return[m(s,Math.min(1,c+f),i),m(s,Math.min(1,c+f),Math.min(.85,i+.15)),m(e,Math.min(1,r+f),h),m(l,Math.min(1,d+f),A),m((s+30)%360,Math.min(1,c+f),i),m((l+30)%360,Math.min(1,d+f),A)].map(I=>_(I,a,3))}function y(t){var e,r;const o=t.primary??C,n=t.secondary??x,a=t.accent??O,s=t.surface??T,c=((e=t.fonts)==null?void 0:e.heading)??g,i=((r=t.fonts)==null?void 0:r.body)??g;return{colors:{primary:o,secondary:n,accent:a,surface:s,border:D(s),textOnPrimary:u(o),textOnSecondary:u(n),textOnAccent:u(a),textOnSurface:u(s),mutedOnSurface:D(s)},palette:B(o,n,a,s),fonts:{heading:{face:c,size:28},body:{face:i,size:16},caption:{face:i,size:14}},logo:t.logo?{src:t.logo.src,position:t.logo.position,width:t.logo.width??80}:void 0}}export{y as resolveBrand,E as wcagContrastRatio};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.