Skip to content

Fix hex color component parsing#471

Open
haaaaaaarshs wants to merge 1 commit into
skiptools:mainfrom
haaaaaaarshs:fix-issue-146
Open

Fix hex color component parsing#471
haaaaaaarshs wants to merge 1 commit into
skiptools:mainfrom
haaaaaaarshs:fix-issue-146

Conversation

@haaaaaaarshs

Copy link
Copy Markdown

Thank you for contributing to the Skip project! Please review the contribution guide at https://skip.dev/docs/contributing/ for advice and guidance on making high-quality PRs.

This PR fixes custom .colorset parsing when asset catalog component values are stored as hexadecimal strings such as "0x94" or "0XFF".

The existing parser attempted to parse every color component with Double(...), which works for normalized decimal strings like "1.000" but fails for hex component strings. This change adds a small parsing path for 0x / 0X values and converts those 8-bit channel values into normalized Double values between 0 and 1, while keeping the existing decimal parsing behavior unchanged.

Closes #146

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement
  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device
  • REQUIRED: I have checked whether this change requires a corresponding update in the Skip Fuse UI repository
  • OPTIONAL: I have added an example of any UI changes to the Showcase sample app

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes:

AI was used to review the implementation for correctness and scope before submission. I manually reviewed the code changes, checked that the implementation specifically handles 0x / 0X hex component strings, preserved the existing decimal parsing behavior, and tested the project locally with swift test.

@cla-bot

cla-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to the Skip community. We require contributors to sign our contributor license agreement (CLA), and we don't seem to have the user(s) @haaaaaaarshs on file. In order for us to review and merge your code, for each noted user please add your GitHub username to Skip's .clabot file

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.

Cannot parse custom colors whose .colorset uses Hex values

1 participant