Skip to content

🧹 Simplify named colors mapping in DotWave#7

Open
jsem-nerad wants to merge 2 commits into
mainfrom
refactor/simplify-named-colors-6076524489690250700
Open

🧹 Simplify named colors mapping in DotWave#7
jsem-nerad wants to merge 2 commits into
mainfrom
refactor/simplify-named-colors-6076524489690250700

Conversation

@jsem-nerad

Copy link
Copy Markdown
Owner

🎯 What: The predefined namedColors map inside _getRGBA in src/dotwave.js was simplified to store only the RGB values instead of repeating the string concatenation for alpha on every line.
💡 Why: This refactoring reduces repetitive string format code, avoids concatenating variables on every map entry, and keeps the configuration cleaner and easier to read or add to in the future.
Verification: Ran Node syntax check on src/dotwave.js to ensure no errors were introduced. Requested code review, which passed.
Result: Improved codebase readability and maintainability without altering the functional output of _getRGBA.


PR created automatically by Jules for task 6076524489690250700 started by @jsem-nerad

Simplify the `namedColors` map in `src/dotwave.js` by storing only the RGB string values instead of the entire string format. Extracted alpha string interpolation to the point of function return.

Co-authored-by: jsem-nerad <88319121+jsem-nerad@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings May 23, 2026 16:19

Copilot AI left a comment

Copy link
Copy Markdown

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 refactors the _getRGBA named color handling in DotWave to reduce repetition by storing only the RGB triplets in the namedColors map and appending alpha at return time. The same change is reflected in the bundled src/dotwave.min.js so distributed usage stays consistent.

Changes:

  • Simplified _getRGBA named color map values from full rgba(...) strings to RGB triplets and centralized the alpha formatting.
  • Updated src/dotwave.min.js to match the new _getRGBA behavior.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
src/dotwave.js Refactors namedColors entries and returns rgba(${rgb}, ${alpha}) for named colors.
src/dotwave.min.js Updates the minified build’s _getRGBA implementation to match the source refactor.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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