fix(schematic): make SCHEMATIC_COMPONENT_OUTLINE_COLOR portable SVG color (#3982) - #4010
Open
PINYOPATTANAWASANPORN wants to merge 1 commit into
Conversation
…olor (tscircuit#3982) Replaces 3-argument 'rgba(132, 0, 0)' with standard 'rgb(132, 0, 0)'. 3-argument rgba() is only valid in CSS Color Level 4 and causes strict SVG parsers/renderers (such as CairoSVG) to fail on generated schematic SVGs.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
rgba(132, 0, 0)with standardrgb(132, 0, 0)inSCHEMATIC_COMPONENT_OUTLINE_COLOR.Root Cause / Technical Context
Fixes #3982. In
lib/utils/constants.ts,SCHEMATIC_COMPONENT_OUTLINE_COLORwas defined as"rgba(132, 0, 0)".While 3-argument
rgba()is supported in modern browsers under CSS Color Level 4, it is invalid under SVG 1.1 / CSS2 color specifications.Strict SVG consumers and renderers (such as CairoSVG or downstream conversion pipelines) fail when parsing generated schematic SVGs containing this color string.
Replacing it with
"rgb(132, 0, 0)"produces the exact same color value while remaining compliant with all SVG and CSS specifications.Verification & Testing
SCHEMATIC_COMPONENT_OUTLINE_COLORconstant exports valid SVG color stringrgb(132, 0, 0).