mirror of https://github.com/helix-editor/helix
fix: use big endian endian
parent
d5f99b666c
commit
94276ba2ac
|
@ -300,7 +300,7 @@ impl Theme {
|
||||||
/// Interpret a Highlight with the RGB foreground
|
/// Interpret a Highlight with the RGB foreground
|
||||||
fn decode_rgb_highlight(highlight: Highlight) -> Option<(u8, u8, u8)> {
|
fn decode_rgb_highlight(highlight: Highlight) -> Option<(u8, u8, u8)> {
|
||||||
(highlight.get() > Self::RGB_START).then(|| {
|
(highlight.get() > Self::RGB_START).then(|| {
|
||||||
let [r, g, b, ..] = (highlight.get() + 1).to_be_bytes();
|
let [.., r, g, b] = (highlight.get() + 1).to_be_bytes();
|
||||||
(r, g, b)
|
(r, g, b)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -309,7 +309,7 @@ impl Theme {
|
||||||
pub const fn rgb_highlight(r: u8, g: u8, b: u8) -> Highlight {
|
pub const fn rgb_highlight(r: u8, g: u8, b: u8) -> Highlight {
|
||||||
// -1 because highlight is "non-max": u32::MAX is reserved for the null pointer
|
// -1 because highlight is "non-max": u32::MAX is reserved for the null pointer
|
||||||
// optimization.
|
// optimization.
|
||||||
Highlight::new(u32::from_be_bytes([r, g, b, u8::MAX]) - 1)
|
Highlight::new(u32::from_be_bytes([u8::MAX, r, g, b]) - 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
Loading…
Reference in New Issue