Skip to content

refactor: replace string with ColorValue for ThemeColors#4945

Merged
adrcotfas merged 1 commit into
v6from
@adrcotfas/refactor/color_value
May 15, 2026
Merged

refactor: replace string with ColorValue for ThemeColors#4945
adrcotfas merged 1 commit into
v6from
@adrcotfas/refactor/color_value

Conversation

@adrcotfas
Copy link
Copy Markdown
Collaborator

Motivation

Mentioned here: #4925 (comment)

Related issue

#4925

Test plan

  • yarn typescript -- no new type errors
  • yarn test -- all tests pass

@callstack-bot
Copy link
Copy Markdown

callstack-bot commented May 14, 2026

Hey @adrcotfas, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

@github-actions
Copy link
Copy Markdown

The mobile version of example app from this branch is ready! You can see it here.

descriptors[route.key].options.tabBarIcon?.({
focused,
color,
color: typeof color === 'string' ? color : '',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

updated react navigation to latest alpha so ColorValue will work #4948

ps: in future throw an error for such scenarios instead of using empty string, so any problems due to future changes are not suppressed

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I see you modified this part in that PR.
I assume I can merge this first since you approved it.

if (isSelectedColor) {
return color(selectedColor).alpha(0.29).rgb().string();
if (typeof selectedColor === 'string') {
return color(selectedColor).alpha(0.29).rgb().string();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we'll need to tweak how we handle color operations so we also support things like var( (for web), which are also strings. could create a utility function that handles these properly.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This part is legacy. We'll anyway modernize each component and this old way of applying alpha will be replaced by using theme color tokens.
I'm not sure about web but I assume that we'll pass the colors in the theme and not in components.

Since you approved this PR I assume you're not requesting an utility function here and now.

@adrcotfas adrcotfas force-pushed the @adrcotfas/refactor/dynamic_themes branch from c8c60d0 to 37e7ed6 Compare May 15, 2026 07:14
Base automatically changed from @adrcotfas/refactor/dynamic_themes to v6 May 15, 2026 07:37
@adrcotfas adrcotfas force-pushed the @adrcotfas/refactor/color_value branch from cb8fee4 to 7380d04 Compare May 15, 2026 07:58
@adrcotfas adrcotfas force-pushed the @adrcotfas/refactor/color_value branch from 7380d04 to 6b7ce40 Compare May 15, 2026 08:17
@github-actions
Copy link
Copy Markdown

The mobile version of example app from this branch is ready! You can see it here.

@adrcotfas adrcotfas merged commit b307cd5 into v6 May 15, 2026
3 checks passed
@adrcotfas adrcotfas deleted the @adrcotfas/refactor/color_value branch May 15, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants