zc2 0.0.45

P2P compute broker with credit-based billing, WAL, and broker mesh support
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! The CLI's colours: zakuro-ai.com's tokens as terminal truecolor, so a
//! `zc://` address or a cost reads the same in the terminal as on the site.
//! `colored` decides whether to emit them (no colour into a pipe, none
//! under `NO_COLOR`).

use colored::{ColoredString, Colorize};

/// The site's tokens. Lightness was picked for a dark ground, which is what
/// the site's terminal is too.
pub mod tone {
    /// `--code-string`: `zc://` addresses.
    pub const URI: (u8, u8, u8) = (0x9B, 0xD4, 0x8F);
}

pub fn paint(s: &str, (r, g, b): (u8, u8, u8)) -> ColoredString {
    s.truecolor(r, g, b)
}