0.0.0 β’ Published 5 months ago
color-pen v0.0.0
ποΈ
Color section
The string color value of the terminal (meaning it cannot be used in a browser environment, (in fact, browsers have a simpler implementation method) :
Color static method
method | rgb θ²εΌ | ο½ Hexadecimal color value |
---|---|---|
fromHexadecimal | --- | --- |
fromRgb | --- | --- |
random | --- | --- |
darkBlack | rgb(86 ,86 ,86) | #565656 |
darkRed | rgb(181 ,40 ,29) | #b5281d |
darkGreen | rgb(50 ,181 ,32) | #32b520 |
darkYellow | rgb(160 ,160 ,29) | #a0a01d |
darkBlue | rgb(64 ,10 ,217) | #400ad9 |
darkMagenta | rgb(201 ,24 ,201) | #c918c9 |
darkCyan | rgb(45 ,174 ,187) | #2daebb |
darkWhite | rgb(193 ,193 ,193) | #c1c1c1 |
lightBlack | rgb(111 ,111 ,111) | #6f6f6f |
red | rgb(252 ,33 ,25) | #fc2119 |
green | rgb(47 ,232 ,26) | #2fe81a |
yellow | rgb(232 ,236 ,20) | #e8ec14 |
blue | rgb(74 ,3 ,254) | #4a03fe |
magenta | rgb(251 ,0 ,253) | #fb00fa |
cyan | rgb(255 ,255 ,255) | #ffffff |
use Color
import { Color, _p } from 'a-node-tools';
/** `_Color` does not necessarily have to ce used together with `_p` οΌ`_p` is just the encapsulation of `process.stdout.write` */
_p(
`${Color.red(
`Red start${Color.yellow('The middle is yellow')} and the red ending`,
)}`,
);
_p(Color.random('Randomly print a string of color values'));
0.0.0
5 months ago