feat: add public ColorArea components, docs, and package contract
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<script setup lang="ts">
|
||||
import { shallowRef } from "vue";
|
||||
import {
|
||||
ColorArea,
|
||||
ColorAreaThumb,
|
||||
ColorSwatch,
|
||||
parseColor,
|
||||
type Color,
|
||||
} from "@heroui-vue/components";
|
||||
|
||||
const color = shallowRef<Color | null>(parseColor("#9B80FF"));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col gap-4">
|
||||
<ColorArea
|
||||
v-model="color"
|
||||
color-space="rgb"
|
||||
x-channel="red"
|
||||
y-channel="green"
|
||||
>
|
||||
<ColorAreaThumb />
|
||||
</ColorArea>
|
||||
<div class="flex w-[300px] items-center gap-3">
|
||||
<ColorSwatch :color="color" size="md" />
|
||||
<p class="text-sm text-muted">
|
||||
Current color:
|
||||
<span class="font-medium">
|
||||
{{ color ? color.toString("hex") : "(empty)" }}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user