UNPKG

linguist-js

Version:

Analyse the programming languages used in a folder or from raw content, using the same rules that GitHub Linguist does.

10 lines (9 loc) 299 B
export function colouredMsg([r, g, b], msg) { return `\u001B[${38};2;${r};${g};${b}m${msg}\u001b[0m`; } export function hexToRgb(hex) { const r = parseInt(hex.slice(1, 3), 16); const g = parseInt(hex.slice(3, 5), 16); const b = parseInt(hex.slice(5, 7), 16); return [r, g, b]; }