| 1 |
use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#; |
| 2 |
use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/::FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr#; |
| 3 |
|
| 4 |
use ansi_termrust-analyzer cargo nu-ansi-term 0.50.3 crate/::Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#; |
| 5 |
use lazy_staticrust-analyzer cargo lazy_static 1.4.0 crate/::lazy_staticrust-analyzer cargo lazy_static 1.4.0 lazy_static!; |
| 6 |
use syntectrust-analyzer cargo syntect 5.3.0 crate/::highlightingrust-analyzer cargo syntect 5.3.0 highlighting/::Colorrust-analyzer cargo syntect 5.3.0 highlighting/style/Color# as SyntectColorrust-analyzer cargo syntect 5.3.0 highlighting/style/Color#; |
| 7 |
|
| 8 |
use craterust-analyzer cargo git-delta 0.19.2 crate/::fatalrust-analyzer cargo git-delta 0.19.2 fatal().; |
| 9 |
use craterust-analyzer cargo git-delta 0.19.2 crate/::git_configrust-analyzer cargo git-delta 0.19.2 git_config/::GitConfigrust-analyzer cargo git-delta 0.19.2 git_config/GitConfig#; |
| 10 |
use craterust-analyzer cargo git-delta 0.19.2 crate/::utilsrust-analyzer cargo git-delta 0.19.2 utils/; |
| 11 |
use ColorModerust-analyzer cargo git-delta 0.19.2 color/ColorMode#::*; |
| 12 |
|
| 13 |
pub fn parse_colorrust-analyzer cargo git-delta 0.19.2 color/parse_color().(s: &str, true_color: bool, git_config: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&GitConfigrust-analyzer cargo git-delta 0.19.2 git_config/GitConfig#>) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#> { |
| 14 |
if s rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq()."normal" { |
| 15 |
return Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#; |
| 16 |
} |
| 17 |
let die = || { |
| 18 |
fatalrust-analyzer cargo git-delta 0.19.2 fatal().(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("Invalid color or style attribute: {s}")); |
| 19 |
}; |
| 20 |
let syntect_color = if s.starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().('#') { |
| 21 |
SyntectColorrust-analyzer cargo syntect 5.3.0 highlighting/style/Color#::from_strrust-analyzer cargo syntect 5.3.0 highlighting/theme_load/impl#[Color][FromStr]from_str().(s).unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_or_else().(|_| die()) |
| 22 |
} else { |
| 23 |
let syntect_color = s |
| 24 |
.parserust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]parse().::<u8>() |
| 25 |
.okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]ok().() |
| 26 |
.and_thenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]and_then().(utilsrust-analyzer cargo git-delta 0.19.2 utils/::syntectrust-analyzer cargo git-delta 0.19.2 utils/syntect/::syntect_color_from_ansi_numberrust-analyzer cargo git-delta 0.19.2 utils/syntect/syntect_color_from_ansi_number().) |
| 27 |
.or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]or_else().(|| utilsrust-analyzer cargo git-delta 0.19.2 utils/::syntectrust-analyzer cargo git-delta 0.19.2 utils/syntect/::syntect_color_from_ansi_namerust-analyzer cargo git-delta 0.19.2 utils/syntect/syntect_color_from_ansi_name().(s)) |
| 28 |
.or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]or_else().(|| utilsrust-analyzer cargo git-delta 0.19.2 utils/::syntectrust-analyzer cargo git-delta 0.19.2 utils/syntect/::syntect_color_from_namerust-analyzer cargo git-delta 0.19.2 utils/syntect/syntect_color_from_name().(s)); |
| 29 |
if syntect_color.is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() { |
| 30 |
if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(git_config) = git_config { |
| 31 |
if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(val) = git_config.getrust-analyzer cargo git-delta 0.19.2 git_config/impl#[GitConfig]get().::<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>(&formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("delta.{s}")) { |
| 32 |
return parse_colorrust-analyzer cargo git-delta 0.19.2 color/parse_color().(&val, true_color, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 33 |
} |
| 34 |
} |
| 35 |
die(); |
| 36 |
} |
| 37 |
syntect_color.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().() |
| 38 |
}; |
| 39 |
utilsrust-analyzer cargo git-delta 0.19.2 utils/::batrust-analyzer cargo git-delta 0.19.2 utils/bat/::terminalrust-analyzer cargo git-delta 0.19.2 utils/bat/terminal/::to_ansi_colorrust-analyzer cargo git-delta 0.19.2 utils/bat/terminal/to_ansi_color().(syntect_color, true_color) |
| 40 |
} |
| 41 |
|
| 42 |
pub fn color_to_stringrust-analyzer cargo git-delta 0.19.2 color/color_to_string().(color: Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# { |
| 43 |
match color { |
| •44 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Defaultrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Default# => todorust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/todo!!(), |
| 45 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Fixedrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Fixed#(n) if n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]lt().16 => ansi_16_color_number_to_namerust-analyzer cargo git-delta 0.19.2 color/ansi_16_color_number_to_name().(n).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 46 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Fixedrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Fixed#(n) => formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{n}"), |
| •47 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Rgbrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Rgb#(r, g, b) => formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("\"#{r:02x?}{g:02x?}{b:02x?}\""), |
| 48 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Blackrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Black# => "black".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| •49 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::DarkGrayrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#DarkGray# => "bright-black".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 50 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Redrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Red# => "red".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| •51 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::LightRedrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#LightRed# => "bright-red".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 52 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Greenrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Green# => "green".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| •53 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::LightGreenrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#LightGreen# => "bright-green".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 54 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Yellowrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Yellow# => "yellow".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| •55 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::LightYellowrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#LightYellow# => "bright-yellow".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 56 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Bluerust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Blue# => "blue".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| •57 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::LightBluerust-analyzer cargo nu-ansi-term 0.50.3 style/Color#LightBlue# => "bright-blue".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 58 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Purplerust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Purple# => "purple".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| •59 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::LightPurplerust-analyzer cargo nu-ansi-term 0.50.3 style/Color#LightPurple# => "bright-purple".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 60 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Magentarust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Magenta# => "magenta".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 61 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::LightMagentarust-analyzer cargo nu-ansi-term 0.50.3 style/Color#LightMagenta# => "bright-magenta".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 62 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Cyanrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Cyan# => "cyan".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| •63 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::LightCyanrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#LightCyan# => "bright-cyan".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 64 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Whiterust-analyzer cargo nu-ansi-term 0.50.3 style/Color#White# => "white".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| •65 |
Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::LightGrayrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#LightGray# => "bright-white".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 66 |
} |
| 67 |
} |
| 68 |
|
| 69 |
// See |
| 70 |
// https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit |
| 71 |
lazy_staticrust-analyzer cargo lazy_static 1.4.0 lazy_static!! { |
| 72 |
static ref ANSI_16_COLORSrust-analyzer cargo git-delta 0.19.2 color/ANSI_16_COLORS#: HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#<&'static str, u8> = { |
| 73 |
vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![ |
| 74 |
("black", 0), |
| 75 |
("red", 1), |
| 76 |
("green", 2), |
| 77 |
("yellow", 3), |
| 78 |
("blue", 4), |
| 79 |
("magenta", 5), |
| 80 |
("purple", 5), |
| 81 |
("cyan", 6), |
| 82 |
("white", 7), |
| 83 |
("bright-black", 8), |
| 84 |
("brightblack", 8), |
| 85 |
("bright-red", 9), |
| 86 |
("brightred", 9), |
| 87 |
("bright-green", 10), |
| 88 |
("brightgreen", 10), |
| 89 |
("bright-yellow", 11), |
| 90 |
("brightyellow", 11), |
| 91 |
("bright-blue", 12), |
| 92 |
("brightblue", 12), |
| 93 |
("bright-magenta", 13), |
| 94 |
("brightmagenta", 13), |
| 95 |
("bright-purple", 13), |
| 96 |
("brightpurple", 13), |
| 97 |
("bright-cyan", 14), |
| 98 |
("brightcyan", 14), |
| 99 |
("bright-white", 15), |
| 100 |
("brightwhite", 15), |
| 101 |
] |
| 102 |
.into_iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][IntoIterator]into_iter().() |
| 103 |
.collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().() |
| 104 |
}; |
| 105 |
} |
| 106 |
|
| 107 |
pub fn ansi_16_color_name_to_numberrust-analyzer cargo git-delta 0.19.2 color/ansi_16_color_name_to_number().(name: &str) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u8> { |
| 108 |
ANSI_16_COLORSrust-analyzer cargo git-delta 0.19.2 color/ANSI_16_COLORS..getrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S, A>`]get().(name).copiedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<&T>`]copied().() |
| 109 |
} |
| 110 |
|
| 111 |
fn ansi_16_color_number_to_namerust-analyzer cargo git-delta 0.19.2 color/ansi_16_color_number_to_name().(n: u8) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&'static str> { |
| 112 |
for (k, _n) in &*rust-analyzer cargo git-delta 0.19.2 color/impl#[ANSI_16_COLORS][Deref]deref().ANSI_16_COLORSrust-analyzer cargo git-delta 0.19.2 color/ANSI_16_COLORS. { |
| 113 |
if *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref()._n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().n { |
| 114 |
return Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().k); |
| 115 |
} |
| 116 |
} |
| 117 |
Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 118 |
} |
| 119 |
|
| 120 |
/// The color mode determines some default color choices |
| 121 |
/// such as the diff background color or the palette used for blame. |
| 122 |
#[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:)] |
| 123 |
pub enum ColorModerust-analyzer cargo git-delta 0.19.2 color/ColorMode# { |
| 124 |
#[defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/default:] |
| 125 |
/// Dark background with light text. |
| 126 |
Darkrust-analyzer cargo git-delta 0.19.2 color/ColorMode#Dark#, |
| 127 |
/// Light background with dark text. |
| 128 |
Lightrust-analyzer cargo git-delta 0.19.2 color/ColorMode#Light#, |
| 129 |
} |
| 130 |
|
| 131 |
pub fn get_minus_background_color_defaultrust-analyzer cargo git-delta 0.19.2 color/get_minus_background_color_default().(mode: ColorModerust-analyzer cargo git-delta 0.19.2 color/ColorMode#, is_true_color: bool) -> Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# { |
| 132 |
match (mode, is_true_color) { |
| 133 |
(Lightrust-analyzer cargo git-delta 0.19.2 color/ColorMode#Light#, true) => LIGHT_THEME_MINUS_COLORrust-analyzer cargo git-delta 0.19.2 color/LIGHT_THEME_MINUS_COLOR., |
| 134 |
(Lightrust-analyzer cargo git-delta 0.19.2 color/ColorMode#Light#, false) => LIGHT_THEME_MINUS_COLOR_256rust-analyzer cargo git-delta 0.19.2 color/LIGHT_THEME_MINUS_COLOR_256., |
| 135 |
(Darkrust-analyzer cargo git-delta 0.19.2 color/ColorMode#Dark#, true) => DARK_THEME_MINUS_COLORrust-analyzer cargo git-delta 0.19.2 color/DARK_THEME_MINUS_COLOR., |
| 136 |
(Darkrust-analyzer cargo git-delta 0.19.2 color/ColorMode#Dark#, false) => DARK_THEME_MINUS_COLOR_256rust-analyzer cargo git-delta 0.19.2 color/DARK_THEME_MINUS_COLOR_256., |
| 137 |
} |
| 138 |
} |
| 139 |
|
| 140 |
pub fn get_minus_emph_background_color_defaultrust-analyzer cargo git-delta 0.19.2 color/get_minus_emph_background_color_default().(mode: ColorModerust-analyzer cargo git-delta 0.19.2 color/ColorMode#, is_true_color: bool) -> Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# { |
| 141 |
match (mode, is_true_color) { |
| 142 |
(Lightrust-analyzer cargo git-delta 0.19.2 color/ColorMode#Light#, true) => LIGHT_THEME_MINUS_EMPH_COLORrust-analyzer cargo git-delta 0.19.2 color/LIGHT_THEME_MINUS_EMPH_COLOR., |
| 143 |
(Lightrust-analyzer cargo git-delta 0.19.2 color/ColorMode#Light#, false) => LIGHT_THEME_MINUS_EMPH_COLOR_256rust-analyzer cargo git-delta 0.19.2 color/LIGHT_THEME_MINUS_EMPH_COLOR_256., |
| 144 |
(Darkrust-analyzer cargo git-delta 0.19.2 color/ColorMode#Dark#, true) => DARK_THEME_MINUS_EMPH_COLORrust-analyzer cargo git-delta 0.19.2 color/DARK_THEME_MINUS_EMPH_COLOR., |
| 145 |
(Darkrust-analyzer cargo git-delta 0.19.2 color/ColorMode#Dark#, false) => DARK_THEME_MINUS_EMPH_COLOR_256rust-analyzer cargo git-delta 0.19.2 color/DARK_THEME_MINUS_EMPH_COLOR_256., |
| 146 |
} |
| 147 |
} |
| 148 |
|
| 149 |
pub fn get_plus_background_color_defaultrust-analyzer cargo git-delta 0.19.2 color/get_plus_background_color_default().(mode: ColorModerust-analyzer cargo git-delta 0.19.2 color/ColorMode#, is_true_color: bool) -> Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# { |
| 150 |
match (mode, is_true_color) { |
| 151 |
(Lightrust-analyzer cargo git-delta 0.19.2 color/ColorMode#Light#, true) => LIGHT_THEME_PLUS_COLORrust-analyzer cargo git-delta 0.19.2 color/LIGHT_THEME_PLUS_COLOR., |
| 152 |
(Lightrust-analyzer cargo git-delta 0.19.2 color/ColorMode#Light#, false) => LIGHT_THEME_PLUS_COLOR_256rust-analyzer cargo git-delta 0.19.2 color/LIGHT_THEME_PLUS_COLOR_256., |
| 153 |
(Darkrust-analyzer cargo git-delta 0.19.2 color/ColorMode#Dark#, true) => DARK_THEME_PLUS_COLORrust-analyzer cargo git-delta 0.19.2 color/DARK_THEME_PLUS_COLOR., |
| 154 |
(Darkrust-analyzer cargo git-delta 0.19.2 color/ColorMode#Dark#, false) => DARK_THEME_PLUS_COLOR_256rust-analyzer cargo git-delta 0.19.2 color/DARK_THEME_PLUS_COLOR_256., |
| 155 |
} |
| 156 |
} |
| 157 |
|
| 158 |
pub fn get_plus_emph_background_color_defaultrust-analyzer cargo git-delta 0.19.2 color/get_plus_emph_background_color_default().(mode: ColorModerust-analyzer cargo git-delta 0.19.2 color/ColorMode#, is_true_color: bool) -> Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# { |
| 159 |
match (mode, is_true_color) { |
| 160 |
(Lightrust-analyzer cargo git-delta 0.19.2 color/ColorMode#Light#, true) => LIGHT_THEME_PLUS_EMPH_COLORrust-analyzer cargo git-delta 0.19.2 color/LIGHT_THEME_PLUS_EMPH_COLOR., |
| 161 |
(Lightrust-analyzer cargo git-delta 0.19.2 color/ColorMode#Light#, false) => LIGHT_THEME_PLUS_EMPH_COLOR_256rust-analyzer cargo git-delta 0.19.2 color/LIGHT_THEME_PLUS_EMPH_COLOR_256., |
| 162 |
(Darkrust-analyzer cargo git-delta 0.19.2 color/ColorMode#Dark#, true) => DARK_THEME_PLUS_EMPH_COLORrust-analyzer cargo git-delta 0.19.2 color/DARK_THEME_PLUS_EMPH_COLOR., |
| 163 |
(Darkrust-analyzer cargo git-delta 0.19.2 color/ColorMode#Dark#, false) => DARK_THEME_PLUS_EMPH_COLOR_256rust-analyzer cargo git-delta 0.19.2 color/DARK_THEME_PLUS_EMPH_COLOR_256., |
| 164 |
} |
| 165 |
} |
| 166 |
|
| •167 |
const LIGHT_THEME_MINUS_COLORrust-analyzer cargo git-delta 0.19.2 color/LIGHT_THEME_MINUS_COLOR.: Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# = Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Rgbrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Rgb#(0xff, 0xe0, 0xe0); |
| 168 |
|
| 169 |
const LIGHT_THEME_MINUS_COLOR_256rust-analyzer cargo git-delta 0.19.2 color/LIGHT_THEME_MINUS_COLOR_256.: Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# = Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Fixedrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Fixed#(224); |
| 170 |
|
| •171 |
const LIGHT_THEME_MINUS_EMPH_COLORrust-analyzer cargo git-delta 0.19.2 color/LIGHT_THEME_MINUS_EMPH_COLOR.: Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# = Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Rgbrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Rgb#(0xff, 0xc0, 0xc0); |
| 172 |
|
| 173 |
const LIGHT_THEME_MINUS_EMPH_COLOR_256rust-analyzer cargo git-delta 0.19.2 color/LIGHT_THEME_MINUS_EMPH_COLOR_256.: Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# = Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Fixedrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Fixed#(217); |
| 174 |
|
| •175 |
const LIGHT_THEME_PLUS_COLORrust-analyzer cargo git-delta 0.19.2 color/LIGHT_THEME_PLUS_COLOR.: Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# = Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Rgbrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Rgb#(0xd0, 0xff, 0xd0); |
| 176 |
|
| 177 |
const LIGHT_THEME_PLUS_COLOR_256rust-analyzer cargo git-delta 0.19.2 color/LIGHT_THEME_PLUS_COLOR_256.: Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# = Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Fixedrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Fixed#(194); |
| 178 |
|
| •179 |
const LIGHT_THEME_PLUS_EMPH_COLORrust-analyzer cargo git-delta 0.19.2 color/LIGHT_THEME_PLUS_EMPH_COLOR.: Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# = Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Rgbrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Rgb#(0xa0, 0xef, 0xa0); |
| 180 |
|
| 181 |
const LIGHT_THEME_PLUS_EMPH_COLOR_256rust-analyzer cargo git-delta 0.19.2 color/LIGHT_THEME_PLUS_EMPH_COLOR_256.: Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# = Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Fixedrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Fixed#(157); |
| 182 |
|
| •183 |
const DARK_THEME_MINUS_COLORrust-analyzer cargo git-delta 0.19.2 color/DARK_THEME_MINUS_COLOR.: Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# = Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Rgbrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Rgb#(0x3f, 0x00, 0x01); |
| 184 |
|
| 185 |
const DARK_THEME_MINUS_COLOR_256rust-analyzer cargo git-delta 0.19.2 color/DARK_THEME_MINUS_COLOR_256.: Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# = Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Fixedrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Fixed#(52); |
| 186 |
|
| •187 |
const DARK_THEME_MINUS_EMPH_COLORrust-analyzer cargo git-delta 0.19.2 color/DARK_THEME_MINUS_EMPH_COLOR.: Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# = Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Rgbrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Rgb#(0x90, 0x10, 0x11); |
| 188 |
|
| 189 |
const DARK_THEME_MINUS_EMPH_COLOR_256rust-analyzer cargo git-delta 0.19.2 color/DARK_THEME_MINUS_EMPH_COLOR_256.: Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# = Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Fixedrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Fixed#(124); |
| 190 |
|
| •191 |
const DARK_THEME_PLUS_COLORrust-analyzer cargo git-delta 0.19.2 color/DARK_THEME_PLUS_COLOR.: Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# = Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Rgbrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Rgb#(0x00, 0x28, 0x00); |
| 192 |
|
| 193 |
const DARK_THEME_PLUS_COLOR_256rust-analyzer cargo git-delta 0.19.2 color/DARK_THEME_PLUS_COLOR_256.: Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# = Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Fixedrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Fixed#(22); |
| 194 |
|
| •195 |
const DARK_THEME_PLUS_EMPH_COLORrust-analyzer cargo git-delta 0.19.2 color/DARK_THEME_PLUS_EMPH_COLOR.: Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# = Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Rgbrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Rgb#(0x00, 0x60, 0x00); |
| 196 |
|
| 197 |
const DARK_THEME_PLUS_EMPH_COLOR_256rust-analyzer cargo git-delta 0.19.2 color/DARK_THEME_PLUS_EMPH_COLOR_256.: Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color# = Colorrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#::Fixedrust-analyzer cargo nu-ansi-term 0.50.3 style/Color#Fixed#(28); |
| 198 |
|
| 199 |
// blame |
| 200 |
|
| 201 |
pub const LIGHT_THEME_BLAME_PALETTErust-analyzer cargo git-delta 0.19.2 color/LIGHT_THEME_BLAME_PALETTE.: &[&str] = &["#FFFFFF", "#DDDDDD", "#BBBBBB"]; |
| 202 |
|
| 203 |
pub const DARK_THEME_BLAME_PALETTErust-analyzer cargo git-delta 0.19.2 color/DARK_THEME_BLAME_PALETTE.: &[&str] = &["#000000", "#222222", "#444444"]; |