Skip to content

fix(filter-chip,suggestion-chip): support a11y high contrast mode on chip components#1195

Open
paulinea wants to merge 9 commits intodevelopfrom
1181-a11y-support-high-contrast-mode-on-chip-component
Open

fix(filter-chip,suggestion-chip): support a11y high contrast mode on chip components#1195
paulinea wants to merge 9 commits intodevelopfrom
1181-a11y-support-high-contrast-mode-on-chip-component

Conversation

@paulinea
Copy link
Copy Markdown
Member

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 31, 2026

Comment thread core/src/main/java/com/orange/ouds/core/component/OudsSuggestionChip.kt Outdated
Comment thread core/src/main/java/com/orange/ouds/core/utilities/OudsPreviewableComponent.kt Outdated
Comment thread core/src/main/java/com/orange/ouds/core/component/OudsChip.kt Outdated
Comment thread core/src/main/java/com/orange/ouds/core/component/OudsChip.kt Outdated
@florentmaitre florentmaitre force-pushed the 1181-a11y-support-high-contrast-mode-on-chip-component branch from d3269b5 to f598919 Compare May 6, 2026 10:13
if (!LocalHighContrastModeEnabled.current) return this

// Composite the background over primary background color to handle transparency
val effectiveBackground = background.compositeOver(OudsTheme.colorScheme.background.primary)
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.

If I am correct, this line makes the assumption that the background color of the app is always background primary. Are we sure about that?

val effectiveColor = compositeOver(effectiveBackground)

// Return the best contrast color for the current color
return if (effectiveColor.luminance() < 0.3f) {
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.

Where does 0.3f comes from? I would have naively thought that we should use 0.5f.

* @return `OudsTheme.colorScheme.always.black` or `OudsTheme.colorScheme.always.white` color when high contrast mode is enabled, or the original color otherwise.
*/
@Composable
fun Color.highContrasted(background: Color = Color.Transparent): 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.

Should this method be internal?

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.

[A11Y] Support High-contrast mode on chip component

2 participants