You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a color from a hex string with Color::from_rgb_str(), the hex string returned with Color::rgb_hex() is different.
Example:
let hex_color_before = "cccccc";
use graphene_core::raster::color::Color;
let color = Color::from_rgb_str(hex_color_before).unwrap();
let hex_color_after = color.rgb_hex();
console_log::init_with_level(log::Level::Info);
log::info!("rgb_hex: {:?}", hex_color_after); //logs "999999"
I'm pretty sure this is not intended behavior
The text was updated successfully, but these errors were encountered:
This is because Color::from_rgb_str() gets mapped from gamma to linear but Color::rgb_hex() doesn't map it back to gamma before printing the output. So that's definitely a bug, although I'll have to consult with @TrueDoctor to decide which part of that process should be fixed. I'm inclined to say that we want all colors to be linear, meaning we convert back to gamma before printing in Color::rgb_hex() (then we have to trace any other usages of that function where we might be accidentally using the wrong linear/gamma and fix it in those too.)
When creating a color from a hex string with
Color::from_rgb_str()
, the hex string returned withColor::rgb_hex()
is different.Example:
I'm pretty sure this is not intended behavior
The text was updated successfully, but these errors were encountered: