44 themeColorWithAlpha ,
55 themeColorWithContrast ,
66 type MobileThemeAppearance ,
7+ type MobileThemeId ,
78 type MobileThemeVariables ,
89} from "../../lib/mobileTheme" ;
910import type { SegmentedControlProps } from "./SegmentedControl.types" ;
@@ -13,6 +14,7 @@ export function segmentedControlColors(
1314 appearance : MobileThemeAppearance ,
1415 variant : SegmentedControlProps < string > [ "variant" ] ,
1516 platform : string ,
17+ themeId : MobileThemeId ,
1618) {
1719 const dark = appearance === "dark" ;
1820 const card = variant === "card" ;
@@ -24,14 +26,19 @@ export function segmentedControlColors(
2426 colors [ "--color-grouped-card" ] ,
2527 )
2628 : flattenThemeColor (
27- themeColorWithAlpha ( colors [ "--color-prominent-action" ] , dark ? 0.18 : 0.07 ) ,
29+ themeColorWithAlpha ( colors [ "--color-prominent-action" ] , dark ? 0.1 : 0.07 ) ,
2830 colors [ "--color-screen" ] ,
2931 ) ;
3032 let selectedColor = colors [ "--color-secondary" ] ;
3133 if ( card && ! dark ) selectedColor = colors [ "--color-screen" ] ;
32- if ( ! card && dark ) selectedColor = colors [ "--color-prominent-action" ] ;
34+ if ( dark && ( ! card || themeId === "t3-code" ) ) {
35+ selectedColor = flattenThemeColor (
36+ themeColorWithAlpha ( colors [ "--color-prominent-action" ] , 0.32 ) ,
37+ colors [ "--color-screen" ] ,
38+ ) ;
39+ }
3340 let selectedTextColor =
34- colors [ ! card && dark ? "--color-prominent-action- foreground" : "--color-secondary-foreground" ] ;
41+ colors [ ! card && dark ? "--color-foreground" : "--color-secondary-foreground" ] ;
3542 if ( ! card && ! dark && platform === "android" ) {
3643 const selection = colors [ "--color-thread-selected" ] ;
3744 if (
0 commit comments