Closed LuckyTurtleDev closed 2 months ago
this is pretty easy to implement (code w/o dependency on rgb
as it's not available on the playground):
fn main() {
let rgb = [255 as u8, 2 as u8, 1 as u8];
println!("RGB ({}, {}, {}) = #{:0>2x}{:0>2x}{:0>2x}", rgb[0], rgb[1], rgb[2], rgb[0], rgb[1], rgb[2]);
}
output:
RGB (255, 2, 1) = #ff0201
see on the playground.
Related to #1. This seems out of scope of this project.
It is easy to implement for the end user:
pub trait ToHtml {
fn to_html(&self) -> String;
}
impl ToHtml for Rgb<u8> {
...
}
I'd recommend closing this.
It would be nice if it will be possible to convert the color to html.
Some thing like this: