tautropfli/terminal-colorsaurus

A library for answering the question «Is this terminal dark or light?» 🦕

Rust

76

340 commits

updated May 6, 2026

See the code

README

terminal-colorsaurus 🦕

Docs Crate Version

A cross-platform library for determining the terminal's background and foreground color.
It answers the question «Is this terminal dark or light?».

Works in all major terminals including Windows Terminal (starting with v1.22).

Example

use terminal_colorsaurus::{theme_mode, QueryOptions, ThemeMode};

match theme_mode(QueryOptions::default()).unwrap() {
    ThemeMode::Dark => { /* ... */ },
    ThemeMode::Light => { /* ... */ },
}

Docs

MSRV Policy

This crate's Minimum Supported Rust Version (MSRV) is based on the MSRVs of downstream users such as delta and bat. Changes to the MSRV will be accompanied by a minor version bump.

The following formula determines the MSRV:

min(msrv(bat), msrv(delta))

Inspiration

This crate borrows ideas from many other projects. This list is by no means exhaustive.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

dark-mode
terminal
tty

tautropfli/terminal-colorsaurus

A library for answering the question «Is this terminal dark or light?» 🦕

Rust

76

340 commits

updated May 6, 2026

See the code

README

terminal-colorsaurus 🦕

Docs Crate Version

A cross-platform library for determining the terminal's background and foreground color.
It answers the question «Is this terminal dark or light?».

Works in all major terminals including Windows Terminal (starting with v1.22).

Example

use terminal_colorsaurus::{theme_mode, QueryOptions, ThemeMode};

match theme_mode(QueryOptions::default()).unwrap() {
    ThemeMode::Dark => { /* ... */ },
    ThemeMode::Light => { /* ... */ },
}

Docs

MSRV Policy

This crate's Minimum Supported Rust Version (MSRV) is based on the MSRVs of downstream users such as delta and bat. Changes to the MSRV will be accompanied by a minor version bump.

The following formula determines the MSRV:

min(msrv(bat), msrv(delta))

Inspiration

This crate borrows ideas from many other projects. This list is by no means exhaustive.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

dark-mode
terminal
tty

Significant stargazers

Wilfred Hughes

1,237 followers · starred Oct 2025

Shun Sakai

368 followers · starred Jan 2025

Jeremy Stucki

82 followers · starred Jan 2024

Rashil Gandhi

109 followers · starred Oct 2025