Skip to content

APP-15246 Add color helper functions#398

Merged
DTCurrie merged 3 commits intomainfrom
APP-15246-add-color-helper-functions
Feb 13, 2026
Merged

APP-15246 Add color helper functions#398
DTCurrie merged 3 commits intomainfrom
APP-15246-add-color-helper-functions

Conversation

@DTCurrie
Copy link
Collaborator

  • Makes the withColors generic function private, it's not useful externally
  • Updates WithRGBA logic to WithColorRGBA to reflect that it is a Color.RGBA struct helper
  • Added a WithRGBA helper that just accepts RGBA values
  • Added a WithHex helper that accepts color hex strings
  • Added ColorFrom* helpers to make it easier to generate a new color with simple requirements

@DTCurrie DTCurrie self-assigned this Feb 13, 2026
@changeset-bot
Copy link

changeset-bot bot commented Feb 13, 2026

🦋 Changeset detected

Latest commit: e8e19e8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@viamrobotics/motion-tools Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

// WithColors creates a configuration option that sets colors for any type implementing ConfigurableColors.
func WithColors[T ConfigurableColors](colors []Color) func(T) {
// withColors creates a configuration option that sets colors for any type implementing ConfigurableColors.
func withColors[T ConfigurableColors](colors []Color) func(T) {
Copy link
Member

Choose a reason for hiding this comment

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

why private now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's generic, so it's not very useful to external users. Technically, I guess it could be useful if folks wanted to add their own custom color options for shapes. But I didn't want it confusing folks using the draw API.

@DTCurrie DTCurrie merged commit 20d5e57 into main Feb 13, 2026
5 checks passed
@DTCurrie DTCurrie deleted the APP-15246-add-color-helper-functions branch February 13, 2026 19:09
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