Skip to content

Fix color configuration and refactor CanvasBoard for readability#46

Merged
pandarudra merged 2 commits into
mainfrom
preview
May 23, 2026
Merged

Fix color configuration and refactor CanvasBoard for readability#46
pandarudra merged 2 commits into
mainfrom
preview

Conversation

@pandarudra
Copy link
Copy Markdown
Owner

This pull request refactors and unifies the color inversion logic across the canvas, properties panel, and sidebar components to ensure consistent color handling in both light and dark themes. It removes legacy color inversion code, centralizes the color inversion logic, and improves the user experience when selecting background and stroke colors. The changes also introduce theme-specific background swatches and update the UI to reflect the selected colors accurately.

Color inversion and theme consistency:

  • Refactored color inversion logic in CanvasBoard.tsx, Left3bar.tsx, and PropertiesPanel.tsx to use a unified invertHexColor function that handles both 3-digit and 6-digit hex codes, ensuring consistent color display and storage in dark and light modes. [1] [2]
  • Updated all color application points (e.g., stroke color, caret color, icon color replacement) to use the unified inversion logic, replacing previous special-case handling of black/white and ensuring all colors invert appropriately in dark mode. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Sidebar and background color improvements:

  • Simplified background color selection in Left3bar.tsx by removing the old inversion logic and introducing separate light and dark color swatch arrays, automatically switching the default background color when the theme changes.
  • Updated the UI for background swatches and custom color picker to reflect the selected color directly, removing the need for inverted storage and display logic. [1] [2]

Code cleanup and minor UI tweaks:

  • Cleaned up import statements and improved formatting for better readability and maintainability. [1] [2]
  • Minor formatting improvements to SVG and UI elements for consistency. [1] [2] [3]

These changes ensure a more predictable and visually consistent color experience for users across all components, regardless of the selected theme.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
draw-wine Ready Ready Preview, Comment May 23, 2026 5:18am

@pandarudra pandarudra merged commit c3c9063 into main May 23, 2026
4 checks passed
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.

2 participants