Skip to content

Commit

Permalink
fix: 修复rgba精度丢失
Browse files Browse the repository at this point in the history
  • Loading branch information
heiazu committed Apr 12, 2024
1 parent 0db69ca commit 81c0914
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub fn fix_rgba(input: String) -> String {
let r = std::str::from_utf8(&caps["r"]).unwrap();
let g = std::str::from_utf8(&caps["g"]).unwrap();
let b = std::str::from_utf8(&caps["b"]).unwrap();
let corrected_alpha = format!("0{:.2}", a);
let corrected_alpha = format!("0{:.6}", a);
return format!("rgba({}, {}, {}, {})", r, g, b, corrected_alpha)
}
}
Expand Down

0 comments on commit 81c0914

Please # to comment.