[github地址:https://github.com/ABCDdouyae...]

gradient-string

用于在终端打印出好看的渐变文字

  • 普通用法
console.log(gradient('cyan', 'pink')('Hello world!'));

let a = 'so beautiful!'
let b = gradient('red', 'green');
console.log(b(a)); let c = gradient(['yellow', 'orange']);
console.log(c(a));
  • 色值写法可以是各种形式
let coolGradient = gradient([
tinycolor('#FFBB65'), // tinycolor object
{r: 0, g: 255, b: 0}, // RGB object
{h: 240, s: 1, v: 1, a: 1}, // HSVa object
'rgb(120, 120, 0)', // RGB CSS string
'gold' // named color
]);