Skip to content

Commit 81c0914

Browse files
committed
fix: 修复rgba精度丢失
1 parent 0db69ca commit 81c0914

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ pub fn fix_rgba(input: String) -> String {
106106
let r = std::str::from_utf8(&caps["r"]).unwrap();
107107
let g = std::str::from_utf8(&caps["g"]).unwrap();
108108
let b = std::str::from_utf8(&caps["b"]).unwrap();
109-
let corrected_alpha = format!("0{:.2}", a);
109+
let corrected_alpha = format!("0{:.6}", a);
110110
return format!("rgba({}, {}, {}, {})", r, g, b, corrected_alpha)
111111
}
112112
}

0 commit comments

Comments
 (0)