Skip to content
Snippets Groups Projects
Verified Commit f3ec0a18 authored by Louis's avatar Louis :fire:
Browse files

Fix missing characters in text format palette

parent c1148076
No related branches found
No related tags found
No related merge requests found
......@@ -21,9 +21,11 @@ pub fn sort_by_hue(palette: &mut PixelPalette) {
let hue_a = pa.hue();
let hue_b = pb.hue();
println!("A: {} vs B: {}", hue_a, hue_b);
if hue_a > hue_b {
if hue_a.is_nan() && hue_b.is_nan() {
Ordering::Equal
} else if hue_a.is_nan() {
Ordering::Less
} else if hue_b.is_nan() || hue_a > hue_b {
Ordering::Greater
} else if hue_b > hue_a {
Ordering::Less
......
......@@ -232,7 +232,7 @@ impl From<BasicLab> for Vec3 {
impl UpperHex for BasicRgba {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.write_str(&format!(
"{:2X}{:2X}{:2X}{:2X}",
"{:02X}{:02X}{:02X}{:02X}",
self.r, self.g, self.b, self.a
))
}
......@@ -240,7 +240,7 @@ impl UpperHex for BasicRgba {
impl LowerHex for BasicRgba {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.write_str(&format!(
"{:2x}{:2x}{:2x}{:2x}",
"{:02x}{:02x}{:02x}{:02x}",
self.r, self.g, self.b, self.a
))
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment