https://github.com/omegatools/color
Small color conversion module.
https://github.com/omegatools/color
bun cmyk deno hex hsl jsr nodejs rgb
Last synced: 2 months ago
JSON representation
Small color conversion module.
- Host: GitHub
- URL: https://github.com/omegatools/color
- Owner: OmegaTools
- License: agpl-3.0
- Created: 2024-03-14T22:41:15.000Z (over 2 years ago)
- Default Branch: Stable
- Last Pushed: 2025-02-11T18:25:59.000Z (over 1 year ago)
- Last Synced: 2025-02-11T19:31:05.734Z (over 1 year ago)
- Topics: bun, cmyk, deno, hex, hsl, jsr, nodejs, rgb
- Language: TypeScript
- Homepage: https://jsr.io/@omega/color
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Omega / Color
*Various color conversions.*
[![Badge Stars]][Stars]
### Hex RGB(A)
```typescript
const hex = '#0000FF' // Blue
const rgb = hexToRGB(hex)
console.debug(rgb) // [ 0 , 0 , 255 ]
```
### HSL(A)
```typescript
const hsl = [ 0 , 100 , 50 ] // Red
const rgb = hslToRGB(hsl)
console.debug(rgb) // [ 255 , 0 , 0 ]
```
### CMYK(A)
```typescript
const cmyka = [ 100 , 0 , 100 , 0 ] // Green
const rgb = cmykToRGB(cmyka)
console.debug(rgb) // [ 120 , 100 , 50 ]
```
[Stars]: https://github.com/OmegaTools/Color
[Usage]: Documentation/Usage.md
[Badge Stars]: https://img.shields.io/github/stars/OmegaTools/RGB?style=for-the-badge&logoColor=white&logo=Trustpilot&labelColor=FF66AA&color=cf538b