@tuoyuan/cli
Version:
拓源网络脚手架
29 lines (28 loc) • 659 B
JavaScript
import chalk from "chalk";
const colors={
success:"#02BF0F", // 成功
error:"#FA3239", // 错误
warning:"#FF952C", //警告
info:"#2196F3", //信息
remind:"#FFCC00",//提醒
}
/**
* 打印Rgb字体
* @param {string} text
*/
function printRgbText(text){
const h3 = chalk.blue.bold.bgRgb(43, 181, 131)(text);
console.log(h3)
}
/**
* 打印 颜色字体
* @param {string} text
* @param {string} type 颜色类型,可选值: success(默认),error,warning,info,remind
*/
function printText(text,type="success"){
const h3 = chalk.hex(colors[type])(text);
console.log(h3)
}
export {
printRgbText,printText
}