# @tanbo/color-picker

> 颜色选择器 ===========================================

Latest version **1.0.3** (published 2022-11-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install @tanbo/color-picker
pnpm add @tanbo/color-picker
yarn add @tanbo/color-picker
bun add @tanbo/color-picker
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2022-11-15 |
| First published | 2019-09-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 79.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | tanbo |
| Maintainers | tanbo |

## Links

- npm: https://www.npmjs.com/package/@tanbo/color-picker
- npm.io page: https://npm.io/package/@tanbo/color-picker

## Dependencies (3)

- [@tanbo/color](https://npm.io/package/@tanbo/color.md) ^0.1.1
- [@tanbo/stream](https://npm.io/package/@tanbo/stream.md) ^1.1.8
- [@tanbo/css-themes](https://npm.io/package/@tanbo/css-themes.md) ^0.0.1

## Recent versions

- 1.0.3 (latest) — 2022-11-15
- 1.0.2 — 2022-10-13
- 1.0.1 — 2022-10-13
- 1.0.0 — 2022-10-12
- 1.0.0-alpha.2 — 2022-10-10
- 1.0.0-alpha.1 — 2022-10-10
- 1.0.0-alpha.0 — 2022-10-10
- 0.1.4 — 2022-06-22
- 0.1.3 — 2022-06-22
- 0.1.2 — 2021-03-30
- 0.1.1 — 2021-03-30
- 0.0.21 — 2020-09-14
- 0.0.20 — 2020-09-14
- 0.0.19 — 2020-09-09
- 0.0.18 — 2020-09-08
- … 7 more at https://npm.io/package/@tanbo/color-picker/versions

## README

颜色选择器
===========================================


## 安装
```
npm install @tanbo/color-picker
```

## 使用

```typescript
import { createPicker } from '@tanbo/color-picker';

const picker = createPicker(document.getElementById('picker'));

// 当用户确认选中颜色后触发
picker.onSelected.subscribe(() => {
  console.log(picker.rgb)
})

// 当用户选择颜色时触发
picker.onChange.subscribe(() => {
  console.log(picker.rgb)
})

// 设置选择器的颜色，你还可以设置其它格式，如 rgba、hex、hsl 等
picker.rgb = {
  r: 255,
  g: 255,
  b: 255
};
```

---
_Source: https://npm.io/package/@tanbo/color-picker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
