openpencil/packages/docs/programmable/sdk/api/advanced/use-okhcl.md
2026-03-30 15:17:30 +03:00

39 lines
911 B
Markdown

---
title: useOkHCL
description: Work with RGBA and OkHCL color models for fills and strokes.
---
# useOkHCL
`useOkHCL()` exposes helpers for reading, enabling, disabling, and updating OkHCL color values on node fills and strokes.
Use it when you are building advanced color tooling that needs to switch between standard RGBA editing and perceptual OkHCL editing.
## Usage
```ts
import { useOkHCL } from '@open-pencil/vue'
const okhcl = useOkHCL()
```
## Returns
- `getFillColorModel()`
- `getStrokeColorModel()`
- `getFillOkHCLColor()`
- `getStrokeOkHCLColor()`
- `enableFillOkHCL()`
- `disableFillOkHCL()`
- `enableStrokeOkHCL()`
- `disableStrokeOkHCL()`
- `updateFillOkHCL()`
- `updateStrokeOkHCL()`
- `modelOptions`
## Related APIs
- [useFillControls](../composables/use-fill-controls)
- [useStrokeControls](../composables/use-stroke-controls)
- [ColorPickerRoot](../components/color-picker-root)