Skip to main content

@omega/color@1.2.11
Built and signed on GitHub Actions

Various color conversions.

This package works with Node.js, Deno, Bun, BrowsersIt is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
6 months ago (1.2.11)
function cmykToHSL
cmykToHSL(cmyk: Array<number>): Array<number>

Converts a CMYK(A) color array to a HSL(A) color array.

Examples

Conversion without alpha channel:

const cmyk = [ 0 , 100 , 100 , 0 ] // Red

const hsl = cmykToHSL(cmyk)

console.debug(hsl) // [ 0 , 100 , 50 ]

Conversion with alpha channel:

const cmyka = [ 100 , 0 , 100 , 0 , 69 ] // Green

const hsl = cmykToHSL(cmyka)

console.debug(hsl) // [ 120 , 100 , 50 , 69 ]

Parameters

[ 𝗖𝘆𝗮𝗻 0 - 100 , 𝗠𝗮𝗴𝗲𝗻𝘁𝗮 0 - 100 , 𝗬𝗲𝗹𝗹𝗼𝘄 0 - 100 , 𝗞𝗲𝘆 0 - 100 , ( 𝗔𝗹𝗽𝗵𝗮 0 - 255 ) ]

Return Type

[ 𝗛𝘂𝗲 0 - 360 , 𝗦𝗮𝘁𝘂𝗿𝗮𝘁𝗶𝗼𝗻 0 - 100 , 𝗟𝗶𝗴𝗵𝘁𝗻𝗲𝘀𝘀 0 - 100 , ( 𝗔𝗹𝗽𝗵𝗮 0 - 255 ) ]

Add Package

deno add jsr:@omega/color

Import symbol

import { cmykToHSL } from "@omega/color/HSL";

---- OR ----

Import directly with a jsr specifier

import { cmykToHSL } from "jsr:@omega/color/HSL";

Add Package

npx jsr add @omega/color

Import symbol

import { cmykToHSL } from "@omega/color/HSL";

Add Package

yarn dlx jsr add @omega/color

Import symbol

import { cmykToHSL } from "@omega/color/HSL";

Add Package

pnpm dlx jsr add @omega/color

Import symbol

import { cmykToHSL } from "@omega/color/HSL";

Add Package

bunx jsr add @omega/color

Import symbol

import { cmykToHSL } from "@omega/color/HSL";