import{bound01 as e,pad2 as t}from"./util.mjs";function n(t,n,r){return{r:e(t,255)*255,g:e(n,255)*255,b:e(r,255)*255}}function r(t,n,r){t=e(t,255),n=e(n,255),r=e(r,255);var i=Math.max(t,n,r),a=Math.min(t,n,r),o=0,s=0,c=(i+a)/2;if(i===a)s=0,o=0;else{var l=i-a;switch(s=c>.5?l/(2-i-a):l/(i+a),i){case t:o=(n-r)/l+(n<r?6:0);break;case n:o=(r-t)/l+2;break;case r:o=(t-n)/l+4;break;default:break}o/=6}return{h:o,s,l:c}}function i(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function a(t,n,r){var a,o,s;if(t=e(t,360),n=e(n,100),r=e(r,100),n===0)o=r,s=r,a=r;else{var c=r<.5?r*(1+n):r+n-r*n,l=2*r-c;a=i(l,c,t+1/3),o=i(l,c,t),s=i(l,c,t-1/3)}return{r:a*255,g:o*255,b:s*255}}function o(t,n,r){t=e(t,255),n=e(n,255),r=e(r,255);var i=Math.max(t,n,r),a=Math.min(t,n,r),o=0,s=i,c=i-a,l=i===0?0:c/i;if(i===a)o=0;else{switch(i){case t:o=(n-r)/c+(n<r?6:0);break;case n:o=(r-t)/c+2;break;case r:o=(t-n)/c+4;break;default:break}o/=6}return{h:o,s:l,v:s}}function s(t,n,r){t=e(t,360)*6,n=e(n,100),r=e(r,100);var i=Math.floor(t),a=t-i,o=r*(1-n),s=r*(1-a*n),c=r*(1-(1-a)*n),l=i%6,u=[r,s,o,o,c,r][l],d=[c,r,r,s,o,o][l],f=[o,o,c,r,r,s][l];return{r:u*255,g:d*255,b:f*255}}function c(e,n,r,i){var a=[t(Math.round(e).toString(16)),t(Math.round(n).toString(16)),t(Math.round(r).toString(16))];return i&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join(``)}function l(e,n,r,i,a){var o=[t(Math.round(e).toString(16)),t(Math.round(n).toString(16)),t(Math.round(r).toString(16)),t(u(i))];return a&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join(``)}function u(e){return Math.round(parseFloat(e)*255).toString(16)}function d(e){return f(e)/255}function f(e){return parseInt(e,16)}function p(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}export{u as convertDecimalToHex,d as convertHexToDecimal,a as hslToRgb,s as hsvToRgb,p as numberInputToObject,f as parseIntFromHex,c as rgbToHex,r as rgbToHsl,o as rgbToHsv,n as rgbToRgb,l as rgbaToHex};