Skip to content
On this page

ColorPicker

When To Use

When there is a color input, the color input box can provide a color input box and a color selector

Examples

Click on the color block to choose a color

<template>
  <h-color-picker v-model:pure-color="shadowColor" />
</template>

<script setup lang="ts">
import { ref } from 'vue';

const shadowColor = ref('#cccccc');
</script>

API

Props

PropertyDescriptionTypedefault
pureColorcolor bindingstringrgb(0,0,0)
gradientColorgradient bindingstring
colorTypeselect color typeenum'RGB'
activeKeyenumpure
isWidgetbooleanfalse
pickerTypecolor Picker typeenumfk
useTypeenumfalse
disableHistoryWhether to disable historybooleanfalse
roundHistorybooleanfalse
disableAlphaWhether to disable transparent valuesboolean
closeBtnCornerclose button positionenumTOP_RIGHT
positionselector positionObject

Events

Events NameDescriptionTypedefault
pureColorChangeColor change callbackFunction
gradientColorChangeGradient color change callbackFunction
activeKeyChangeColor selection change callbackFunction