From fbed77de4310d20e0bee0553a9da6e7b18b4a150 Mon Sep 17 00:00:00 2001 From: Keavon Chambers Date: Sat, 12 Sep 2026 03:02:50 -0700 Subject: [PATCH] Rename the 'Hex to Color' node to 'String to Color' --- editor/src/messages/portfolio/document_migration.rs | 4 ++++ node-graph/nodes/math/src/lib.rs | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/editor/src/messages/portfolio/document_migration.rs b/editor/src/messages/portfolio/document_migration.rs index 792aa807233..1fe2976c121 100644 --- a/editor/src/messages/portfolio/document_migration.rs +++ b/editor/src/messages/portfolio/document_migration.rs @@ -399,6 +399,10 @@ const NODE_REPLACEMENTS: &[NodeReplacement<'static>] = &[ node: graphene_std::math_nodes::sine_inverse::IDENTIFIER, aliases: &["graphene_math_nodes::SineInverseNode", "graphene_core::ops::SineInverseNode"], }, + NodeReplacement { + node: graphene_std::math_nodes::string_to_color::IDENTIFIER, + aliases: &["math_nodes::HexToColorNode"], + }, NodeReplacement { node: graphene_std::math_nodes::subtract::IDENTIFIER, aliases: &["graphene_math_nodes::SubtractNode", "graphene_core::ops::SubtractNode"], diff --git a/node-graph/nodes/math/src/lib.rs b/node-graph/nodes/math/src/lib.rs index c793a8f9612..4c3b65917e3 100644 --- a/node-graph/nodes/math/src/lib.rs +++ b/node-graph/nodes/math/src/lib.rs @@ -1365,9 +1365,9 @@ fn hsla_to_color( } /// Constructs a color value from a CSS color string. Accepts hex (`#RRGGBB`, `#RRGGBBAA`, plus bare and shorthand variants), CSS named colors (like `red`), and functional notations (`rgb(...)`, `hsl(...)`, etc.). Invalid inputs produce a transparent color. -#[node_macro::node(category("Color"), name("Hex to Color"))] -fn hex_to_color(_: impl Ctx, hex_code: Item) -> Item { - let color = core_types::misc::parse_css_color(hex_code.element()).unwrap_or_default(); +#[node_macro::node(category("Color"), name("String to Color"))] +fn string_to_color(_: impl Ctx, string: Item) -> Item { + let color = core_types::misc::parse_css_color(string.element()).unwrap_or_default(); Item::new_from_element(color) }