import {i,h,G,H as H$1,O,P,E as E$1,n,F,j,k,m,l}from'../chunk-JT2PPQ6V.mjs';import {a}from'../chunk-2FEDFNW7.mjs';import'../chunk-YQKSXMBN.mjs';import {b}from'../chunk-WGY6QKPW.mjs';import'../chunk-GLKEY6D3.mjs';import {b as b$1}from'../chunk-IOXRZECH.mjs';var $=(r,o,e)=>a(...j(r,o,e)),A=(r,o,e)=>{let[n,t,m]=i(r,o,e);return [b(n),b(t),b(m)]},S=(r,o,e,n)=>{h(r,o,e,n),r[0]=b(r[0]),r[1]=b(r[1]),r[2]=b(r[2]);},E=(r,o,e)=>A(...G(r,o,e)),q=(r,o,e,n)=>{H$1(r,o,e,n),S(r,r[0],r[1],r[2]);},I=Math.PI/180,R=(r,o,e)=>A(...O(r,o,e)),M=(r,o,e,n)=>{P(r,o,e,n),S(r,r[0],r[1],r[2]);},z=(r,o,e)=>{let n=e*I;return R(r,o*Math.cos(n),o*Math.sin(n))},H=(r,o,e,n)=>{let t=n*I;M(r,o,e*Math.cos(t),e*Math.sin(t));},J=r=>E$1(r,n),v=(r,o,e)=>{r.toGamutP3=n$1=>{let t=F(n$1,n,$);if(t===null)return new r(n$1);let[m,a,u]=t.linear,[k,F$1,G]=j(m,a,u);return r._makeFromLinearSrgb(k,F$1,G,t.alpha)},r.prototype.toP3=function(n=4){let{r:t,g:m,b:a,alpha:u}=k(this._rawRgb());return {r:b$1(t,n),g:b$1(m,n),b:b$1(a,n),alpha:u,colorSpace:"display-p3"}},r.prototype.toP3String=function(n=4){let{r:t,g:m,b:a,alpha:u}=this.toP3(n);return u<1?`color(display-p3 ${t} ${m} ${a} / ${u})`:`color(display-p3 ${t} ${m} ${a})`},o.push(m,l),e.push([m,"p3"],[l,"p3"]);},K=v;export{K as default,J as inGamutP3,R as labToP3Channels,M as labToP3ChannelsInto,z as lchToP3Channels,H as lchToP3ChannelsInto,A as linearToP3Channels,S as linearToP3ChannelsInto,E as oklchToP3Channels,q as oklchToP3ChannelsInto};//# sourceMappingURL=p3.mjs.map
//# sourceMappingURL=p3.mjs.map