Use window background for cosmic color schemes (#102)
This commit is contained in:
parent
470437e55a
commit
c0d7fed185
2 changed files with 12 additions and 6 deletions
|
|
@ -102,10 +102,16 @@ fn convert_color(colors: &Colors, color: Color) -> cosmic_text::Color {
|
||||||
let rgb = match color {
|
let rgb = match color {
|
||||||
Color::Named(named_color) => match colors[named_color] {
|
Color::Named(named_color) => match colors[named_color] {
|
||||||
Some(rgb) => rgb,
|
Some(rgb) => rgb,
|
||||||
None => {
|
None => match named_color {
|
||||||
log::warn!("missing named color {:?}", named_color);
|
NamedColor::Background => {
|
||||||
Rgb::default()
|
// Allow using an unset background
|
||||||
}
|
return cosmic_text::Color(0);
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
log::warn!("missing named color {:?}", named_color);
|
||||||
|
Rgb::default()
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Color::Spec(rgb) => rgb,
|
Color::Spec(rgb) => rgb,
|
||||||
Color::Indexed(index) => match colors[index as usize] {
|
Color::Indexed(index) => match colors[index as usize] {
|
||||||
|
|
|
||||||
|
|
@ -476,7 +476,7 @@ fn cosmic_dark() -> Colors {
|
||||||
|
|
||||||
// Set special colors
|
// Set special colors
|
||||||
colors[NamedColor::Foreground] = colors[NamedColor::BrightWhite];
|
colors[NamedColor::Foreground] = colors[NamedColor::BrightWhite];
|
||||||
colors[NamedColor::Background] = colors[NamedColor::Black];
|
// Background comes from theme settings: colors[NamedColor::Background] = colors[NamedColor::Black];
|
||||||
colors[NamedColor::Cursor] = colors[NamedColor::BrightWhite];
|
colors[NamedColor::Cursor] = colors[NamedColor::BrightWhite];
|
||||||
colors[NamedColor::BrightForeground] = colors[NamedColor::BrightWhite];
|
colors[NamedColor::BrightForeground] = colors[NamedColor::BrightWhite];
|
||||||
|
|
||||||
|
|
@ -517,7 +517,7 @@ fn cosmic_light() -> Colors {
|
||||||
|
|
||||||
// Set special colors
|
// Set special colors
|
||||||
colors[NamedColor::Foreground] = colors[NamedColor::Black];
|
colors[NamedColor::Foreground] = colors[NamedColor::Black];
|
||||||
colors[NamedColor::Background] = colors[NamedColor::BrightWhite];
|
// Background comes from theme settings: colors[NamedColor::Background] = colors[NamedColor::BrightWhite];
|
||||||
colors[NamedColor::Cursor] = colors[NamedColor::Black];
|
colors[NamedColor::Cursor] = colors[NamedColor::Black];
|
||||||
colors[NamedColor::BrightForeground] = colors[NamedColor::BrightBlack];
|
colors[NamedColor::BrightForeground] = colors[NamedColor::BrightBlack];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue