mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Assume at least 8 colors (#565)
This commit is contained in:
parent
7cf597f9bb
commit
85f6372c68
@ -74,6 +74,7 @@ fn find_closest_pair(pair: ColorPair, max_colors: i16) -> (i16, i16) {
|
|||||||
/// If `max_colors` is less than 256 (like 8 or 16), the color will be
|
/// If `max_colors` is less than 256 (like 8 or 16), the color will be
|
||||||
/// downgraded to the closest one available.
|
/// downgraded to the closest one available.
|
||||||
fn find_closest(color: Color, max_colors: i16) -> i16 {
|
fn find_closest(color: Color, max_colors: i16) -> i16 {
|
||||||
|
let max_colors = std::cmp::max(max_colors, 8);
|
||||||
match color {
|
match color {
|
||||||
Color::TerminalDefault => -1,
|
Color::TerminalDefault => -1,
|
||||||
Color::Dark(BaseColor::Black) => 0,
|
Color::Dark(BaseColor::Black) => 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user