Skip to content

ColorPickerHueCursor

This is a Hue Cursor Component that implements only minimal styling.

Usage

vue
<script setup lang="ts">
import {
  ColorPickerHue,
  ColorPickerHueCursor,
  useColorPicker,
} from "@wattanx/vue-color-picker";

const { onMoveHue, selfColor, huePosition } = useColorPicker({
  initialColor: "#FFFFFF",
  width: 160,
  height: 160,
});
</script>
<template>
  <ColorPickerHue class="color-picker-hue" @moveHue="onMoveHue">
    <ColorPickerHueCursor
      class="color-picker-hue-cursor"
      :hue="selfColor.hsv.h"
      :direction="'vertical'"
      :position="huePosition"
    ></ColorPickerHueCursor>
  </ColorPickerHue>
</template>

Props

NameTypeDescription
hue requirednumberHue value.
direction required'horizontal' | 'vertical'Direction of the cursor.
position required{ x: number; y: number }Position of the cursor.

Released under the MIT License.