New nodes: RGBA to Color, HSVA to Color, Hex to Color, and Read Gradient#3838
New nodes: RGBA to Color, HSVA to Color, Hex to Color, and Read Gradient#3838
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the color manipulation capabilities within the node graph system by introducing several new nodes for creating colors from various formats (RGBA, HSVA, HSLA, and Hex strings). It also adds a new node for reading gradient data. Concurrently, the PR refactors the internal color parsing logic, centralizing hex string conversion and introducing a specialized method for overlay colors, which is then adopted across the editor's overlay drawing functions. These changes improve the flexibility of color definition in the node graph and streamline color handling in the editor's UI. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
6afda12 to
45681b0
Compare
There was a problem hiding this comment.
3 issues found across 12 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="node-graph/nodes/math/src/lib.rs">
<violation number="1" location="node-graph/nodes/math/src/lib.rs:803">
P1: Missing `_primary: ()` parameter — `hex_code` is the primary (wire) input instead of a user-editable property. Unlike the sibling `rgba_to_color`, `hsva_to_color`, and `hsla_to_color` nodes (and all other value constructor nodes), this node can't have the hex code typed directly in the properties panel. Add `_primary: ()` before `hex_code` to make it consistent.</violation>
</file>
<file name="node-graph/libraries/no-std-types/src/color/color_types.rs">
<violation number="1" location="node-graph/libraries/no-std-types/src/color/color_types.rs:988">
P1: Behavioral regression: `from_rgba_str` no longer performs sRGB-to-linear conversion or alpha premultiplication. The local closure `from_rgba8_srgb` shadows the method name but has completely different semantics—it just maps u8 values to [0,1] floats without color space conversion. This breaks the existing caller in `value.rs` which parses hex color defaults via `from_hex_str`, causing colors to be in gamma sRGB (straight alpha) instead of linear sRGB (premultiplied alpha). If the intent is to return raw sRGB values for the new "Hex to Color" node, consider creating a separate function rather than changing the shared `from_rgba_str`.</violation>
<violation number="2" location="node-graph/libraries/no-std-types/src/color/color_types.rs:1014">
P1: Behavioral regression: `from_rgb_str` no longer performs sRGB-to-linear conversion. The local closure `from_rgb8_srgb` creates a raw gamma-space `Color` instead of calling `Color::from_rgb8_srgb(r, g, b)` which converts to linear. This changes behavior for all callers of `from_rgb_str` and `from_hex_str`, including the default-value parser in `value.rs`.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
Code Review
This pull request introduces several new nodes for color manipulation, such as RGBA to Color, HSVA to Color, and Hex to Color, along with a Read Gradient node. The changes also include a refactoring of color parsing functions, replacing widespread use of from_rgb_str with a more specific from_rgb_hex_for_overlays for overlay rendering to maintain correct color handling. My review focuses on improving code clarity and reducing duplication in the new color parsing logic.
Performance Benchmark Results
|
Performance Benchmark Results
|
Closes #2774