matryer / xbar

Put the output from any script or program into your macOS Menu Bar (the BitBar reboot)
https://xbarapp.com
MIT License
17.49k stars 643 forks source link

different colors/params for title #823

Open JasinYip opened 2 years ago

JasinYip commented 2 years ago

I would like to implement a stock price monitor plugin with using different colors for the title.

For example:

APPL +3.5%, TSLA -2.2%

It will be great if I can make the +3.5% green and the -2.2% red.

But for now, the parameters of xbar looks can only set a single color for it.

leaanthony commented 2 years ago

You should be able to use ANSI colour codes

JasinYip commented 2 years ago

You should be able to use ANSI colour codes

I tried chalk to generate ANSI color code and it doesn't works, only shows the default color.

const chalk = require('chalk')
console.log(chalk.green('hihi'));