0.0.0 β€’ Published 5 months ago

color-pen v0.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

πŸ–ŠοΈ

version NPM Last Update πŸ“¦ size downloads downloads

last commit GitHub commit activity


πŸ‡¨πŸ‡³ δΈ­ζ–‡ 🌍 English πŸ‘€ change log submit πŸ™‹β€β™‚οΈ issue


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

methodrgb θ‰²ε€Όο½œ Hexadecimal color value
fromHexadecimal------
fromRgb------
random------
darkBlackrgb(86 ,86 ,86)#565656
darkRedrgb(181 ,40 ,29)#b5281d
darkGreenrgb(50 ,181 ,32)#32b520
darkYellowrgb(160 ,160 ,29)#a0a01d
darkBluergb(64 ,10 ,217)#400ad9
darkMagentargb(201 ,24 ,201)#c918c9
darkCyanrgb(45 ,174 ,187)#2daebb
darkWhitergb(193 ,193 ,193)#c1c1c1
lightBlackrgb(111 ,111 ,111)#6f6f6f
redrgb(252 ,33 ,25)#fc2119
greenrgb(47 ,232 ,26)#2fe81a
yellowrgb(232 ,236 ,20)#e8ec14
bluergb(74 ,3 ,254)#4a03fe
magentargb(251 ,0 ,253)#fb00fa
cyanrgb(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