Skip to content

Commit 6ff5e46

Browse files
committed
Refactoring imports
1 parent b0fac75 commit 6ff5e46

File tree

16 files changed

+440
-361
lines changed

16 files changed

+440
-361
lines changed

src/ansi/color/bit24_colors.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/ansi/color/bit4_colors.ts

Lines changed: 0 additions & 48 deletions
This file was deleted.

src/ansi/color/bit8_colors.ts

Lines changed: 0 additions & 258 deletions
This file was deleted.

src/ansi/colors/24bit/color.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { NumberRange } from "../../../type/mod.ts";
2+
3+
/**
4+
* This interface represents a 24 bit color.
5+
*/
6+
export interface Color {
7+
red : NumberRange<0, 255>,
8+
green : NumberRange<0, 255>,
9+
blue : NumberRange<0, 255>
10+
};
11+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { ValuesFromObject } from "../../../type/mod.ts";
2+
3+
/**
4+
* This object contains all 4-Bit background color codes.
5+
*
6+
* [Wikipedia](https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit)
7+
*/
8+
const backgroundColors = {
9+
BLACK: '40',
10+
RED: '41',
11+
GREEN: '42',
12+
YELLOW: '43',
13+
BLUE: '44',
14+
MAGENTA: '45',
15+
CYAN: '46',
16+
WHITE: '47',
17+
BLACK_BRIGHT: '100',
18+
RED_BRIGHT: '101',
19+
GREEN_BRIGHT: '102',
20+
YELLOW_BRIGHT: '103',
21+
BLUE_BRIGHT: '104',
22+
MAGENTA_BRIGHT: '105',
23+
CYAN_BRIGHT: '106',
24+
WHITE_BRIGHT: '107',
25+
} as const;
26+
27+
export default backgroundColors;
28+
29+
/**
30+
* This type gets generated from the values of {@linkcode backgroundColors}.
31+
*/
32+
export type BackgroundColor = ValuesFromObject<typeof backgroundColors>;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { ValuesFromObject } from "../../../type/mod.ts";
2+
3+
/**
4+
* This object contains all 4-Bit foreground color codes.
5+
*
6+
* [Wikipedia](https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit)
7+
*/
8+
const foregroundColors = {
9+
BLACK: '30',
10+
RED: '31',
11+
GREEN: '32',
12+
YELLOW: '33',
13+
BLUE: '34',
14+
MAGENTA: '35',
15+
CYAN: '36',
16+
WHITE: '37',
17+
BLACK_BRIGHT: '90',
18+
RED_BRIGHT: '91',
19+
GREEN_BRIGHT: '92',
20+
YELLOW_BRIGHT: '93',
21+
BLUE_BRIGHT: '94',
22+
MAGENTA_BRIGHT: '95',
23+
CYAN_BRIGHT: '96',
24+
WHITE_BRIGHT: '97',
25+
} as const;
26+
27+
export default foregroundColors;
28+
29+
/**
30+
* This type gets generated from the values of {@linkcode foregroundColors}.
31+
*/
32+
export type ForegroundColor = ValuesFromObject<typeof foregroundColors>;

0 commit comments

Comments
 (0)