MCPcopy Create free account
hub / github.com/Xu22Web/tech-study-js / printColor

Function printColor

tech-study.js:2003–2008  ·  view source on GitHub ↗

* @description 打印颜色 * @param text * @param color

(color, ...text)

Source from the content-addressed store, hash-verified

2001 * @param color
2002 */
2003function printColor(color, ...text) {
2004 const textFormatted = text
2005 .map((t) => (typeof t === 'object' ? JSON.stringify(t) : String(t)))
2006 .join(' ');
2007 console.log(`%c[${formatDateTime()}] %c${textFormatted}`, '', `color: ${color}`);
2008}
2009/**
2010 * @description html进度条
2011 * @param title

Callers 3

logFunction · 0.70
errorFunction · 0.70
infoFunction · 0.70

Calls 1

formatDateTimeFunction · 0.70

Tested by

no test coverage detected