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

Fix missing characters in text format palette

parent 8b788538
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) { ...@@ -21,9 +21,11 @@ pub fn sort_by_hue(palette: &mut PixelPalette) {
let hue_a = pa.hue(); let hue_a = pa.hue();
let hue_b = pb.hue(); let hue_b = pb.hue();
println!("A: {} vs B: {}", hue_a, hue_b); if hue_a.is_nan() && hue_b.is_nan() {
Ordering::Equal
if hue_a > hue_b { } else if hue_a.is_nan() {
Ordering::Less
} else if hue_b.is_nan() || hue_a > hue_b {
Ordering::Greater Ordering::Greater
} else if hue_b > hue_a { } else if hue_b > hue_a {
Ordering::Less Ordering::Less
......
...@@ -232,7 +232,7 @@ impl From<BasicLab> for Vec3 { ...@@ -232,7 +232,7 @@ impl From<BasicLab> for Vec3 {
impl UpperHex for BasicRgba { impl UpperHex for BasicRgba {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.write_str(&format!( f.write_str(&format!(
"{:2X}{:2X}{:2X}{:2X}", "{:02X}{:02X}{:02X}{:02X}",
self.r, self.g, self.b, self.a self.r, self.g, self.b, self.a
)) ))
} }
...@@ -240,7 +240,7 @@ impl UpperHex for BasicRgba { ...@@ -240,7 +240,7 @@ impl UpperHex for BasicRgba {
impl LowerHex for BasicRgba { impl LowerHex for BasicRgba {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.write_str(&format!( f.write_str(&format!(
"{:2x}{:2x}{:2x}{:2x}", "{:02x}{:02x}{:02x}{:02x}",
self.r, self.g, self.b, self.a 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