import{ae as Q,B as X,aQ as K,aR as R,ag as f,aS as te,C as G,aT as se,aU as O,aV as A,al as b,aW as y,am as n,ap as k,aX as E,aY as F,aZ as H,a_ as S,aA as Y,aB as Z,an as a,ai as u,ao as j,au as U,az as L,at as T,aj as z,as as ee,aw as oe,a$ as ae,aM as N,b0 as q,af as ne,v as ue,ah as re,ak as J,b1 as de}from"./index-D68iA7pN.js";import{M as ie}from"./index-AOcxwHT9.js";import{M as ce}from"./index-fM-yRA8C.js";import{V as ve}from"./VColorPicker-OJXTdtLi.js";import{V as me}from"./VSlider-Bmvc6aBM.js";const fe={class:"pa-1"},pe={class:"ml-2 mt-1"},xe={class:"px-2 pt-1 pb-4"},Ce={class:"colors d-flex flex-column flex-wrap mt-1 mirrorRotateVertical",style:{height:"100px"}},be=["onMousemove","onClick"],ge={class:"colors d-flex flex-column flex-wrap mt-3",style:{height:"100px"}},Ve=["onMousemove","onClick"],ye={style:{height:"24px"}},ke={class:"d-flex justify-space-between mt-1"},$e={class:"index-colors d-flex flex-wrap"},he=["onMousemove","onClick"],_e={class:"index-colors d-flex flex-wrap"},Me=["onMousemove","onClick"],Ue={class:"superimposed-layer align-self-end mt-2"},P=9,W=7,Se=Q({__name:"IndexColor",props:{color:{},method:{}},emits:["update:color"],setup(c,{emit:g}){const $=g,x=t=>{$("update:color",t)},w=X(),{colorIndexList:r}=K(w),v=R(()=>r.value.slice(0,P)),I=R(()=>r.value.slice(r.value.length-W,r.value.length-1)),B=R(()=>r.value.slice(P,r.value.length-W).filter((t,i)=>i%2!==0)),h=R(()=>r.value.slice(P,r.value.length-W-1).filter((t,i)=>i%2===0)),d=f(-1),V=f(-1),m=f(c.color),l=f(""),e=f(!1),o=c.color.toString();te(()=>{const t=G(c.color),i=t.red(),s=t.green(),_=t.blue(),M=se(i,s,_,!1);V.value=M,d.value=M,l.value=O[M]||M.toString(),c.method!==A.kByACI&&(l.value=`${i},${s},${_}`)});const p=t=>{d.value=t.index,l.value=O[t.index]||t.index.toString(),x(t.color)},C=t=>{l.value=t;const i=O[t];typeof i=="number"?d.value=i:d.value=Number(t)},D=t=>{m.value=t.color,V.value=t.index},le=R(()=>{const t=G(m.value);return`${t.red()}, ${t.green()}, ${t.blue()}`});return(t,i)=>(b(),y("div",fe,[n("p",pe,"MxCAD"+k(t.t("563"))+"(ACI):",1),n("div",xe,[n("div",{onMouseout:i[0]||(i[0]=s=>e.value=!1),onMousemove:i[1]||(i[1]=s=>e.value=!0)},[n("div",Ce,[(b(!0),y(E,null,F(h.value,(s,_)=>(b(),y("div",{class:H(["color-box",d.value===s.index?"active-color-box":""]),style:S({backgroundColor:s.color}),onMousemove:M=>D(s),onClick:M=>p(s)},null,46,be))),256))]),n("div",ge,[(b(!0),y(E,null,F(B.value,(s,_)=>(b(),y("div",{class:H(["color-box",d.value===s.index?"active-color-box":""]),style:S({backgroundColor:s.color}),onMousemove:M=>D(s),onClick:M=>p(s)},null,46,Ve))),256))])],32),n("div",ye,[n("div",ke,[Y(n("span",null,k(t.t("10")+":"+V.value),513),[[Z,e.value]]),Y(n("span",null,"RGB: "+k(le.value),513),[[Z,e.value]])])]),a(ee,null,{default:u(()=>[a(j,{cols:"6"},{default:u(()=>[n("div",{onMouseout:i[2]||(i[2]=s=>e.value=!1),onMousemove:i[3]||(i[3]=s=>e.value=!0)},[n("div",$e,[(b(!0),y(E,null,F(v.value,s=>(b(),y("div",{class:H(["color-box",d.value===s.index?"active-color-box":""]),style:S({backgroundColor:s.color}),onMousemove:_=>D(s),onClick:_=>p(s)},null,46,he))),256))]),n("div",_e,[(b(!0),y(E,null,F(I.value,s=>(b(),y("div",{class:H(["color-box",d.value===s.index?"active-color-box":""]),style:S({backgroundColor:s.color}),onMousemove:_=>D(s),onClick:_=>p(s)},null,46,Me))),256))])],32),a(U,{class:"mt-2","model-value":l.value,"onUpdate:modelValue":C},{prepend:u(()=>[a(L,{"key-name":"C"},{default:u(()=>[T(k(t.t("155")),1)]),_:1})]),_:1},8,["model-value"])]),_:1}),a(j,{cols:"6",class:"d-flex justify-end"},{default:u(()=>[n("div",Ue,[n("div",{class:"box1",style:S({backgroundColor:z(o)})},null,4),n("div",{class:"box2",style:S({backgroundColor:t.color})},null,4)])]),_:1})]),_:1})])]))}}),we=oe(Se,[["__scopeId","data-v-44224bb8"]]),Ie={class:"pa-1"},Be={class:"d-flex mr-12"},De={class:""},Le={class:"ml-5"},Te={class:"d-flex flex-column justify-center align-center"},Ne={class:"d-flex flex-column"},Re={class:"superimposed-layer align-self-end m-t mb-2"},Ae=Q({__name:"TrueColor",props:{color:{default:"#fff"},method:{}},emits:["update:color"],setup(c,{emit:g}){const $=g,x=l=>{V(l),$("update:color",l)},w=c.color.toString(),r=f(0),v=f(0),I=f(0),B=f(0),h=f(0),d=f(0),V=l=>{const e=G(l);r.value=N(e.red(),0),v.value=N(e.blue(),0),I.value=N(e.green(),0);const o=2;B.value=N(e.hue(),o),h.value=N(e.saturationl(),o),d.value=N(e.lightness(),o)};ae(()=>c.color,l=>{if(l)try{V(l)}catch{}}),V(c.color);const m=(l,e)=>{const o=G(c.color);x(o[l](Number(e)).toString())};return(l,e)=>(b(),y("div",Ie,[a(ee,null,{default:u(()=>[a(j,{cols:"7","align-self":"start"},{default:u(()=>[n("div",Be,[n("div",De,[a(L,{"key-name":"E"},{default:u(()=>[T(k(l.t("564")),1)]),_:1}),a(U,{class:"",type:"number",modelValue:B.value,"onUpdate:modelValue":[e[0]||(e[0]=o=>B.value=o),e[1]||(e[1]=o=>m("hue",o))]},null,8,["modelValue"])]),n("div",Le,[a(L,{"key-name":"S"},{default:u(()=>[T(k(l.t("565")),1)]),_:1}),a(U,{class:"",type:"number",modelValue:h.value,"onUpdate:modelValue":[e[2]||(e[2]=o=>h.value=o),e[3]||(e[3]=o=>m("saturationl",o))]},null,8,["modelValue"])])]),a(ve,{class:"mt-4 mx-color-picker","hide-inputs":"","model-value":l.color,"onUpdate:modelValue":x,elevation:"0",rounded:"0",width:"300"},null,8,["model-value"]),a(U,{"model-value":l.color,"onUpdate:modelValue":x},{prepend:u(()=>e[14]||(e[14]=[n("span",null,"HEX: ",-1)])),_:1},8,["model-value"])]),_:1}),a(j,{cols:"2","align-self":"start"},{default:u(()=>[n("div",Te,[n("div",Ne,[a(L,{"key-name":"L"},{default:u(()=>[T(k(l.t("566")),1)]),_:1}),a(U,{class:"",type:"number",modelValue:d.value,"onUpdate:modelValue":[e[4]||(e[4]=o=>d.value=o),e[5]||(e[5]=o=>m("lightness",o))]},null,8,["modelValue"]),a(me,{class:"mx-color-slider",direction:"vertical",modelValue:d.value,"onUpdate:modelValue":[e[6]||(e[6]=o=>d.value=o),e[7]||(e[7]=o=>m("lightness",o))]},null,8,["modelValue"])])])]),_:1}),a(j,{cols:"3","align-self":"end"},{default:u(()=>[a(U,{class:"mt-1",type:"number",modelValue:r.value,"onUpdate:modelValue":[e[8]||(e[8]=o=>r.value=o),e[9]||(e[9]=o=>m("red",o))]},{prepend:u(()=>[a(L,{"key-name":"R"},{default:u(()=>[T(k(l.t("567")),1)]),_:1})]),_:1},8,["modelValue"]),a(U,{class:"mt-1",type:"number",modelValue:v.value,"onUpdate:modelValue":[e[10]||(e[10]=o=>v.value=o),e[11]||(e[11]=o=>m("blue",o))]},{prepend:u(()=>[a(L,{"key-name":"G"},{default:u(()=>[T(k(l.t("568")),1)]),_:1})]),_:1},8,["modelValue"]),a(U,{class:"mt-1",type:"number",modelValue:I.value,"onUpdate:modelValue":[e[12]||(e[12]=o=>I.value=o),e[13]||(e[13]=o=>m("green",o))]},{prepend:u(()=>[a(L,{"key-name":"B"},{default:u(()=>[T(k(l.t("569")),1)]),_:1})]),_:1},8,["modelValue"]),n("div",Re,[n("div",{class:"box1",style:S(`background:${z(w)};`)},null,4),n("div",{class:"box2",style:S(`background:${l.color};`)},null,4)])]),_:1})]),_:1})]))}}),je=oe(Ae,[["__scopeId","data-v-954b1431"]]),ze=()=>{const c=f("#000"),g=f(A.kByACI),$=f(0),x=[{tab:"索引颜色",component:()=>q(we,{color:c.value,method:g.value,"onUpdate:color":v=>{c.value=v,r(A.kByACI)}})},{tab:"真彩色",component:()=>q(je,{color:c.value,method:g.value,"onUpdate:color":v=>{c.value=v,r(A.kByColor)}})}],w=v=>{c.value=v},r=v=>{g.value=v,$.value=v===A.kByColor?1:0};return{items:x,color:c,setColor:w,setMethod:r,tab:$,method:g}},Ee={class:"px-1"},We=Q({__name:"index",setup(c){const{items:g,color:$,tab:x,method:w,setColor:r,setMethod:v}=ze(),{createColor:I}=X(),{colorSelectList:B,currentSelectColor:h}=K(X());let d;const V=(o={call:(p,C)=>{const D=I({...de(p,C)});B.value.unshift(D),h.value=D},color:h.value})=>{const{call:p,color:C}=o;l(!0),d=p,C&&(r(C.color),v(C.method))},{isShow:m,showDialog:l}=ne(!1,"Mx_Color",V);ue.on("openCustomColorDiallog",V);const e=[{name:"确定",fun:()=>{d&&d($.value,w.value),l(!1)},primary:!0},{name:"取消",fun:()=>l(!1)}];return(o,p)=>(b(),re(ie,{modelValue:z(m),"onUpdate:modelValue":p[1]||(p[1]=C=>J(m)?m.value=C:null),footerBtnList:e,"max-width":"580",title:o.t("562")},{default:u(()=>[n("div",Ee,[a(ce,{modelValue:z(x),"onUpdate:modelValue":p[0]||(p[0]=C=>J(x)?x.value=C:null),items:z(g),"tabs-props":{grow:!0},height:386},null,8,["modelValue","items"])])]),_:1},8,["modelValue","title"]))}});export{We as default};