MCPcopy Create free account
hub / github.com/bytespider/Meross / percentToColor

Function percentToColor

packages/cli/src/cli.ts:19–20  ·  view source on GitHub ↗
(percent: number)

Source from the content-addressed store, hash-verified

17 * Converts a decimal between zero and one to TerminalKit color code
18 */
19export const percentToColor = (percent: number): string =>
20 percent > 0.7 ? '^G' : percent > 0.5 ? '^Y' : percent > 0.3 ? '^y' : '^r';
21
22/**
23 * Draws a coloured bar of specified width

Callers 1

barFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected