Deprecate all usages of the Color struct representing gamma space values, fixing round-trip precision bugs (#4149)

* Deprecate all usages of the Color struct representing gamma space values, fixing round-trip precision bugs

* Code review fixes
This commit is contained in:
Keavon Chambers
2026-05-14 22:48:33 -07:00
committed by GitHub
parent 456a7c868d
commit a56746c6bf
67 changed files with 1210 additions and 941 deletions

View File

@@ -2,6 +2,7 @@ use super::DocumentNode;
use crate::application_io::PlatformEditorApi;
use crate::proto::{Any as DAny, FutureAny};
use brush_nodes::brush_stroke::BrushStroke;
use core_types::color::SRGBA8;
use core_types::list::List;
use core_types::transform::Footprint;
use core_types::uuid::NodeId;
@@ -464,7 +465,7 @@ impl TaggedValue {
// String syntax (e.g. "000000ff")
if input.starts_with('"') && input.ends_with('"') {
let hex = input.trim().trim_matches('"').trim().trim_start_matches('#');
let color = Color::from_hex_str(hex);
let color = SRGBA8::from_hex_str(hex).map(Color::from);
if color.is_none() {
log::error!("Invalid default value color string: {input}");
}