문서 선택

UIColorPicker

색상 채널을 조절해 색을 선택합니다.

기본 사용법

강조 색상 선택

색상 영역에서 채도와 명도를 조절하고, 색조 슬라이더나 텍스트 입력에서 값을 바꿉니다. 투명도 조절은 allow-alpha로 추가합니다.

<script setup lang="ts">
import { UIColorPicker } from "@connextable/ui";
import { ref } from "vue";

const selectedColor = ref("#5b6df6");
</script>

<template>
  <UIColorPicker v-model="selectedColor" label="강조 색상" />
</template>

설정과 동작

텍스트로 색상 입력

HEX 값을 입력해 선택색을 바꿉니다.

표현 형식 바꾸기

같은 색상을 HEX와 HSV로 확인합니다.

투명도 조절

알파 슬라이더로 투명도를 변경합니다.

RGB 채널 직접 입력

채널 숫자를 바꾸면 색상 값이 갱신됩니다.

브라우저 색상 선택기

브라우저의 색상 선택 입력을 사용합니다.

구성 컴포넌트

구조와 배치

UIColorPickerArea

값을 편집하거나 조절하는 영역입니다.

UIColorPickerAreaSurface

색상 좌표를 가리키는 조작 영역의 표면입니다.

값 입력과 선택

UIColorPickerNativeInput

브라우저의 기본 색상 선택 입력을 연결합니다.

브라우저 색상 선택기 예제
UIColorPickerTextInput

색상 값을 텍스트로 입력하고 편집합니다.

텍스트로 색상 입력 예제
UIColorPickerChannelInput

색상의 특정 채널 값을 입력합니다.

UIColorPickerCoordinateInput

색상 좌표의 값을 숫자로 입력합니다.

RGB 채널 직접 입력 예제
UIColorPickerCoordinateSlider

색상 좌표의 값을 슬라이더로 조정합니다.

UIColorPickerAreaThumb

색상 영역 안에서 현재 좌표를 표시하는 손잡이입니다.

UIColorPickerHueSlider

현재 색상의 색상각을 조절합니다.

UIColorPickerAlphaSlider

현재 색상의 투명도를 조절합니다.

투명도 조절 예제

탐색과 동작

UIColorPickerControl

컨트롤 또는 동작 버튼을 묶는 영역입니다.

표현 형식 바꾸기 예제
UIColorPickerFormatTrigger

색상 값을 표시하고 편집하는 서식을 바꿉니다.

표현 형식 바꾸기 예제

값과 상태 표시

UIColorPickerLabel

컨트롤의 이름을 화면과 접근성 트리에 제공합니다.

RGB 채널 직접 입력 예제
UIColorPickerSwatch

현재 색상을 색상 견본으로 표시합니다.

투명도 조절 예제
UIColorPickerValueText

현재 값의 텍스트 표현을 표시합니다.

투명도 조절 예제

주요 API

UIColorPicker속성과 모델

v-model타입string | undefined

선택된 색상 문자열을 연결합니다.

텍스트로 색상 입력 예제
allow-alpha타입boolean | undefined

투명도 채널을 사용할지 지정합니다.

투명도 조절 예제

UIColorPicker입력 상태

readonly타입boolean

값을 유지하고 사용자 조작으로 변경되는 것을 막습니다. 읽기와 탐색은 계속 지원합니다.

disabled타입boolean

입력과 선택을 비활성화합니다. 네이티브 입력은 Tab 순서에서 빠집니다.

UIColorPicker슬롯

#default타입(props: ColorPickerRootSlotProps) => VNodeChild

text 등 현재 색상 상태를 읽습니다.

표현 형식 바꾸기 예제

UIColorPickerTextInput속성과 모델

placeholder타입string

빈 색상 입력에 서식의 예를 표시합니다. 기본 색상 선택기는 현재 표시 형식에 맞춰 예를 생성합니다.

텍스트로 색상 입력 예제
전체 속성, 이벤트와 슬롯

UIColorPicker

model-value
string | undefined
default-value
string | undefined
draft
string | null | undefined
default-draft
string | null | undefined
format
ColorFormat | undefined
default-format
ColorFormat | undefined
allow-alpha
boolean | undefined
channel-step
number | undefined
alpha-step
number | undefined
disabled
boolean | undefined
readonly
boolean | undefined
label
string | undefined
name
string | undefined
form
string | undefined
required
boolean | undefined
as
PrimitiveAs | undefined
as-child
boolean | undefined
@update:model-value
(_value: string) => any
@update:draft
(_value: string | null) => any
@update:format
(_value: ColorFormat) => any
#default
(props: ColorPickerRootSlotProps) => VNodeChild

UIColorPickerLabel

as-child
boolean | undefined
as
PrimitiveAs | undefined
#default
(props: ColorPickerRootSlotProps) => VNodeChild

UIColorPickerControl

as-child
boolean | undefined
as
PrimitiveAs | undefined
#default
(props: ColorPickerRootSlotProps) => VNodeChild

UIColorPickerNativeInput

as
PrimitiveAs | undefined
as-child
boolean | undefined
#default
(props: ColorPickerRootSlotProps) => VNodeChild

UIColorPickerTextInput

as
PrimitiveAs | undefined
as-child
boolean | undefined
#default
(props: ColorPickerRootSlotProps) => VNodeChild

UIColorPickerChannelInput

as
PrimitiveAs | undefined
as-child
boolean | undefined
channel필수
ColorChannel
#default
(props: ColorPickerRootSlotProps) => VNodeChild

UIColorPickerCoordinateInput

as
PrimitiveAs | undefined
as-child
boolean | undefined
format필수
ColorModel
coordinate필수
ColorCoordinate
#default
(props: ColorPickerRootSlotProps) => VNodeChild

UIColorPickerCoordinateSlider

as
PrimitiveAs | undefined
as-child
boolean | undefined
format필수
ColorModel
coordinate필수
ColorCoordinate
#default
(props: ColorPickerRootSlotProps) => VNodeChild

UIColorPickerArea

as
PrimitiveAs | undefined
as-child
boolean | undefined
#default
(props: ColorPickerRootSlotProps) => VNodeChild

UIColorPickerAreaSurface

as
PrimitiveAs | undefined
as-child
boolean | undefined
#default
(props: ColorPickerRootSlotProps) => VNodeChild

UIColorPickerAreaThumb

as-child
boolean | undefined
as
PrimitiveAs | undefined
#default
(props: ColorPickerRootSlotProps) => VNodeChild

UIColorPickerHueSlider

as
PrimitiveAs | undefined
as-child
boolean | undefined
#default
(props: ColorPickerRootSlotProps) => VNodeChild

UIColorPickerAlphaSlider

as
PrimitiveAs | undefined
as-child
boolean | undefined
#default
(props: ColorPickerRootSlotProps) => VNodeChild

UIColorPickerSwatch

as
PrimitiveAs | undefined
as-child
boolean | undefined
#default
(props: ColorPickerRootSlotProps) => VNodeChild

UIColorPickerValueText

as
PrimitiveAs | undefined
as-child
boolean | undefined
#default
(props: ColorPickerRootSlotProps) => VNodeChild

UIColorPickerFormatTrigger

as
PrimitiveAs | undefined
as-child
boolean | undefined
format필수
ColorFormat
#default
(props: ColorPickerRootSlotProps) => VNodeChild