Skip to content

Adjust Prism xychart series palette#155

Merged
jongalloway merged 1 commit intomainfrom
issue-143-xychart-prism-palette
Mar 31, 2026
Merged

Adjust Prism xychart series palette#155
jongalloway merged 1 commit intomainfrom
issue-143-xychart-prism-palette

Conversation

@jongalloway
Copy link
Copy Markdown
Owner

Closes #143.

Summary

  • switch Prism-style xycharts away from the accent-only ladder when the theme has a monochrome NodePalette and multi-stop BorderGradientStops
  • derive xychart series colors from ThemePaletteResolver.ResolveEffectivePalette(...) and soften them toward the background so bars stay readable without taking on the old vivid solid-blue look
  • keep existing accent-driven xychart colors for non-Prism themes
  • add a focused renderer test for Prism xychart series colors
  • add a Prism xychart E2E fixture and snapshot baseline

Validation

  • dotnet test tests/DiagramForge.Tests/DiagramForge.Tests.csproj -c Release --filter "FullyQualifiedName~Render_XyChart_WithPrism_UsesSoftenedBorderGradientSeriesColors"
  • dotnet test tests/DiagramForge.E2ETests/DiagramForge.E2ETests.csproj -c Release

Notes

This implements the middle-ground approach from the issue: Prism bars use lighter, softened series colors derived from the theme's border-gradient palette rather than staying fully white or using the previous accent-only ladder.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Mermaid xychart-beta series fill colors to better match the Prism theme’s “border-carries-emphasis” style by deriving series colors from the theme’s effective palette (gradient-stop-derived for Prism) and blending them toward the background for readability, while leaving non-Prism themes on the existing accent-driven ladder.

Changes:

  • Adjust SvgRenderSupport.GetXyChartSeriesColor() to use ThemePaletteResolver.ResolveEffectivePalette(...) for Prism-like themes (monochrome NodePalette + multi-stop BorderGradientStops), then soften fills via blending.
  • Add a focused unit test asserting Prism xychart series colors come from the softened effective palette (and not the prior accent ladder).
  • Add a Prism xychart E2E fixture + snapshot baseline to lock in the rendered SVG output.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
src/DiagramForge/Rendering/SvgRenderSupport.cs Switches Prism-like xychart series fills to a softened effective-palette strategy; keeps legacy accent ladder otherwise.
tests/DiagramForge.Tests/DiagramRendererTests.cs Adds a renderer test validating Prism xychart series colors use softened effective palette colors rather than accent-ladder colors.
tests/DiagramForge.E2ETests/Fixtures/mermaid-xychart-prism.input New Prism-themed Mermaid xychart fixture input for snapshot coverage.
tests/DiagramForge.E2ETests/Fixtures/mermaid-xychart-prism.expected.svg New snapshot baseline capturing the expected Prism xychart rendering with the updated series fill colors.

@jongalloway jongalloway merged commit 46cb693 into main Mar 31, 2026
9 checks passed
@jongalloway jongalloway deleted the issue-143-xychart-prism-palette branch March 31, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mermaid xychart: bar fills bypass Prism white-fill strategy

2 participants