commit
This commit is contained in:
parent
b5a7ab3c6b
commit
ebb0552a13
9 changed files with 186 additions and 36 deletions
|
@ -24,7 +24,7 @@ fn parse_rgb8_from_hex_str(s: &str) -> Result<RGB8, ParsingError> {
|
|||
}
|
||||
|
||||
fn fmt_rgb8_as_hex_string(v: &RGB8, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
f.write_fmt(format_args!("{:#04x}{:#04x}{:#04x}", v.r, v.g, v.b))
|
||||
f.write_fmt(format_args!("#{:02x}{:02x}{:02x}", v.r, v.g, v.b))
|
||||
}
|
||||
|
||||
fn parse_rgba8_from_hex_str(s: &str) -> Result<RGBA8, ParsingError> {
|
||||
|
@ -42,7 +42,7 @@ fn parse_rgba8_from_hex_str(s: &str) -> Result<RGBA8, ParsingError> {
|
|||
}
|
||||
|
||||
fn fmt_rgba8_as_hex_string(v: &RGBA8, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
f.write_fmt(format_args!("{:#04x}{:#04x}{:#04x}{:#04x}", v.r, v.g, v.b, v.a))
|
||||
f.write_fmt(format_args!("#{:02x}{:02x}{:02x}{:02x}", v.r, v.g, v.b, v.a))
|
||||
}
|
||||
|
||||
fn parse_rgb8_with_optional_alpha_from_hex_str(s: &str, fallback_alpha: u8) -> Result<RGBA8, ParsingError> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue