Skip to content

Introduce Color value object across wallet builders and Pass models#3

Draft
Korbeil wants to merge 1 commit intofeature/update-google-spec-20260409from
feature/rework-color-fields
Draft

Introduce Color value object across wallet builders and Pass models#3
Korbeil wants to merge 1 commit intofeature/update-google-spec-20260409from
feature/rework-color-fields

Conversation

@Korbeil
Copy link
Copy Markdown
Member

@Korbeil Korbeil commented Apr 9, 2026

Summary

This change replaces ad-hoc color handling with a small, validated Color value object and threads it through shared builder state and all supported wallet platforms.

What changed

  • Added Jolicode\WalletKit\Common\Color with factories for RGB components, #rrggbb hex, and rgb(r, g, b) strings, plus rgb() and hex() serializers; invalid input throws InvalidColorException.
  • Updated CommonWalletState and wallet builders so background, foreground, and label colors are typed as Color instead of strings.
  • Adjusted Apple, Google Wallet (Android), and Samsung pass models and normalizers to consume or emit colors consistently with the new type.
  • Removed the internal ColorMapper in favor of the unified Color API.

Testing

Extended or updated normalizer and builder tests; added coverage for Color behavior.

@Korbeil Korbeil force-pushed the feature/rework-color-fields branch from 2e83352 to 06a75bd Compare April 9, 2026 21:09
@Korbeil Korbeil force-pushed the feature/rework-color-fields branch from 06a75bd to e050aa4 Compare April 9, 2026 21:12
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.

1 participant