
Detects terminal color support, reports capability levels (basic, 256, 16m), respects NO_COLOR and environment heuristics, and offers per-stream detection for stdout/stderr.
This is a Kotlin Multiplatform line-by-line transliteration port of zkat/supports-color.
Original Project: This port is based on zkat/supports-color. All design credit and project intent belong to the upstream authors; this repository is a faithful port to Kotlin Multiplatform with no behavioural changes intended.
This is an in-progress port. The goal is feature parity with the upstream Rust crate while providing a native Kotlin Multiplatform API. Every Kotlin file carries a // port-lint: source <path> header naming its upstream Rust counterpart so the AST-distance tool can track provenance.
The text below is reproduced and lightly edited from
https://github.com/zkat/supports-color. It is the upstream project's own description and remains under the upstream authors' authorship; links have been rewritten to absolute upstream URLs so they continue to resolve from this repository.
Detects whether a terminal supports color, and gives details about that
support. It takes into account the NO_COLOR environment variable.
This crate is a Rust port of @sindresorhus' NPM package by the same name.
use supports_color::Stream;
if let Some(support) = supports_color::on(Stream::Stdout) {
if support.has_16m {
println!("16 million (RGB) colors are supported");
} else if support.has_256 {
println!("256 colors are supported.");
} else if support.has_basic {
println!("Only basic ANSI colors are supported.");
}
} else {
println!("No color support.");
}dependencies {
implementation("io.github.kotlinmania:supports-color-kotlin:0.1.1")
}./gradlew build
./gradlew testSee AGENTS.md and CLAUDE.md for translator discipline, port-lint header convention, and Rust → Kotlin idiom mapping.
This Kotlin port is distributed under the same Apache-2.0 license as the upstream zkat/supports-color. See LICENSE (and any sibling LICENSE-* / NOTICE files mirrored from upstream) for the full text.
Original work copyrighted by the supports-color authors.
Kotlin port: Copyright (c) 2026 Sydney Renee and The Solace Project.
Thanks to the zkat/supports-color maintainers and contributors for the original Rust implementation. This port reproduces their work in Kotlin Multiplatform; bug reports about upstream design or behavior should go to the upstream repository.
This is a Kotlin Multiplatform line-by-line transliteration port of zkat/supports-color.
Original Project: This port is based on zkat/supports-color. All design credit and project intent belong to the upstream authors; this repository is a faithful port to Kotlin Multiplatform with no behavioural changes intended.
This is an in-progress port. The goal is feature parity with the upstream Rust crate while providing a native Kotlin Multiplatform API. Every Kotlin file carries a // port-lint: source <path> header naming its upstream Rust counterpart so the AST-distance tool can track provenance.
The text below is reproduced and lightly edited from
https://github.com/zkat/supports-color. It is the upstream project's own description and remains under the upstream authors' authorship; links have been rewritten to absolute upstream URLs so they continue to resolve from this repository.
Detects whether a terminal supports color, and gives details about that
support. It takes into account the NO_COLOR environment variable.
This crate is a Rust port of @sindresorhus' NPM package by the same name.
use supports_color::Stream;
if let Some(support) = supports_color::on(Stream::Stdout) {
if support.has_16m {
println!("16 million (RGB) colors are supported");
} else if support.has_256 {
println!("256 colors are supported.");
} else if support.has_basic {
println!("Only basic ANSI colors are supported.");
}
} else {
println!("No color support.");
}dependencies {
implementation("io.github.kotlinmania:supports-color-kotlin:0.1.1")
}./gradlew build
./gradlew testSee AGENTS.md and CLAUDE.md for translator discipline, port-lint header convention, and Rust → Kotlin idiom mapping.
This Kotlin port is distributed under the same Apache-2.0 license as the upstream zkat/supports-color. See LICENSE (and any sibling LICENSE-* / NOTICE files mirrored from upstream) for the full text.
Original work copyrighted by the supports-color authors.
Kotlin port: Copyright (c) 2026 Sydney Renee and The Solace Project.
Thanks to the zkat/supports-color maintainers and contributors for the original Rust implementation. This port reproduces their work in Kotlin Multiplatform; bug reports about upstream design or behavior should go to the upstream repository.