Skip to content
目录

Color Picker Panel

A panel color picker with Hue and optional Alpha controls. You can also paste #RGB/#RRGGBB or rgb()/rgba() into the input to sync back.

Basic

html
<template>
  <dk-color-picker-panel v-model="value" />
</template>

<script setup>
import { ref } from 'vue'

const value = ref('#409EFF')
</script>
展开

Alpha (show-alpha)

html
<template>
  <dk-color-picker-panel v-model="value" show-alpha format="rgb" />
</template>
展开

Disabled

html
<template>
  <dk-color-picker-panel v-model="value" disabled />
</template>
展开

Props

NameDescriptionTypeDefault
model-value / v-modelbinding valuestring''
disableddisabled statebooleanfalse
show-alphashow alpha sliderbooleanfalse
formatoutput format'hex' | 'rgb' | 'hsl''hex'
widthpanel widthstring'280px'

Events

NameDescriptionParams
update:modelValuev-model update(value: string)
active-changeemitted while dragging(value: string)
changeemitted on drag end / input sync(value: string)
update:rgbaRGBA update(rgba: { r: number; g: number; b: number; a: number })

Contributors

Mr.Fan