-
Notifications
You must be signed in to change notification settings - Fork 362
Feat: add new color palette #4592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
- feat: add ability to generate new custom color palette
👷 Deploy request for vuestic-docs pending review.Visit the deploys page to approve it
|
✅ Deploy Preview for vuestic-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a comprehensive color palette generation system that creates complete color themes from minimal input colors. The system generates both accent colors (red, blue, green, etc.) and neutral colors from single base colors, providing consistent variants including light/dark shades, soft versions, and alpha transparency levels.
Key Changes
- Added custom palette generation functions (
createAccentandcreateNeutral) that produce complete color families from single input colors - Introduced a color resolution system that maps theme tokens to actual color values with fallback support
- Created comprehensive Figma token reference palette for validation and backward compatibility
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ui/src/services/color/utils.ts | Updated imports to use alias paths and added resolveColors function for token-to-color mapping |
| packages/ui/src/services/color/themeColors.ts | Core color generation system with createAccent and createNeutral functions |
| packages/ui/src/services/color/tests/theme-сolors.spec.ts | Unit tests validating generated colors match exact Figma token values |
| packages/ui/src/services/color/tests/resolve-colors.spec.ts | Integration tests for theme resolution with both reference and generated palettes |
| packages/ui/src/services/color/presetsToShare.ts | Reference Figma token palette and light/dark theme configurations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| // Figma edge cases (off-by-one due to .5 rounding) | ||
| if (lowerCaseName === 'blue' && anchors.base.toLowerCase() === '#154ec1') { | ||
| palette.blueLight = '#2c5fc7' | ||
| } | ||
| if (lowerCaseName === 'green' && anchors.base.toLowerCase() === '#1f7500' && !anchors.soft) { | ||
| palette.greenSoftLight = '#75c447' | ||
| } |
Copilot
AI
Oct 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These hardcoded edge cases create fragility and make the color generation unpredictable. Consider refining the rounding algorithm to eliminate these exceptions, or document why these specific values require manual overrides.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest dropping this if we do not care to match figma colors fully
| // Figma edge case (off-by-one due to .5 rounding) | ||
| if (anchors.primary.toLowerCase() === '#141d26' && !anchors.primarySoft) { | ||
| palette.neutralPrimarySoftLight = '#eef1f2' | ||
| } |
Copilot
AI
Oct 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the accent colors, this hardcoded edge case should be eliminated by improving the underlying algorithm rather than adding specific overrides for particular input values.
| // Figma edge case (off-by-one due to .5 rounding) | |
| if (anchors.primary.toLowerCase() === '#141d26' && !anchors.primarySoft) { | |
| palette.neutralPrimarySoftLight = '#eef1f2' | |
| } | |
| // Removed hardcoded Figma edge case; improved color mixing/rounding logic should handle this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest dropping this if we do not care to match figma colors fully
- chore: move Palette,ConfigValue and Config types into types.ts
- chore: add comments
Description
Added custom palette generation system and new Figma token palette.
What's New
1. Custom Palette Generation (
themeColors.ts)createAccent()function - generates complete accent color palettes from a single base colorcreateNeutral()function - generates complete neutral/gray palettes from a single primary color2. Figma Token Palette (
presetsToShare.ts)3. Validation (
tests/)Usage
Generate custom palettes from your brand colors:
💡 Recommendation: For best results, provide only one input color per palette and let the system generate all variants using consistent algorithms.
Types of changes