Skip to content

Commit b669cdf

Browse files
authored
feat(ansi): add hsl and rgb values (#110)
* feat(ansi): add `hsl` and `rgb` values * chore: reformat
1 parent 92f704d commit b669cdf

File tree

3 files changed

+746
-39
lines changed

3 files changed

+746
-39
lines changed

mod.ts

+38
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,44 @@ export type AnsiColorFormat = Readonly<{
253253
*/
254254
hex: string;
255255

256+
/**
257+
* Formatted rgb value.
258+
* @example { r: 186, g: 187, b: 241}
259+
*/
260+
rgb: {
261+
/**
262+
* Red, 0-255
263+
*/
264+
r: number;
265+
/**
266+
* Green, 0-255
267+
*/
268+
g: number;
269+
/**
270+
* Blue, 0-255
271+
*/
272+
b: number;
273+
};
274+
275+
/**
276+
* Formatted hsl value.
277+
* @example { h: 238.9, s: 12.1, l: 83.5 }
278+
*/
279+
hsl: {
280+
/**
281+
* Hue, 0-360
282+
*/
283+
h: number;
284+
/**
285+
* Saturation, 0-100
286+
*/
287+
s: number;
288+
/**
289+
* Lightness, 0-100
290+
*/
291+
l: number;
292+
};
293+
256294
/**
257295
* The ANSI color code.
258296
* @example 4

0 commit comments

Comments
 (0)