/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../core/maybe","./number"],(function(r,t,n){"use strict";const e=[255,255,255,1],i=[0,0,0,0];function o(r,t){return Array.isArray(t)?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3]):(r[0]=t.r,r[1]=t.g,r[2]=t.b,r[3]=t.a),r}function u(r,t=0,n=!1){const e=r[t+3];return r[t+0]*=e,r[t+1]*=e,r[t+2]*=e,n||(r[t+3]*=255),r}function l(r){return u(o([],r))}function c(r){return u(o(i,r)),n.i8888to32(i[0],i[1],i[2],i[3])}function p(r){if(!r)return 0;const{r:t,g:e,b:i,a:o}=r,u=t*o,l=e*o,c=i*o,p=255*o;return n.i8888to32(u,l,c,p)}function a(r){if(!r)return 0;const[t,e,i,o]=r,u=t*(o/255),l=e*(o/255),c=i*(o/255),p=o;return n.i8888to32(u,l,c,p)}function f(r,n,e=0){if(t.isNone(n))return r[e+0]=0,r[e+1]=0,r[e+2]=0,void(r[e+3]=0);const{r:i,g:o,b:u,a:l}=n;r[e+0]=i*l/255,r[e+1]=o*l/255,r[e+2]=u*l/255,r[e+3]=l}r.copyAndPremultiply=l,r.premultiplyAlpha=u,r.premultiplyAlphaRGBA=p,r.premultiplyAlphaRGBAArray=a,r.premultiplyAlphaUint32=c,r.white=e,r.writeColor=f,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
