Skip to content

Conversation

@arronhunt
Copy link
Contributor

@arronhunt arronhunt commented Nov 30, 2023


Resolves #34136 by using the correct algorithm for darkening colors that will produce consistent results regardless of color format. Previously, a color darkened by a coefficient would produce different results if the color was an rgb color vs. hsl color.

Before After
image image

Another natural side effect is that default colors will be more vibrant.

Before After
626e9a0626b46f07530c1b3c2d8aef794b1b352e6d02bcb03d058a62d9e705eb b81769c2efefb0ba5c138dc9210b541f3eb98a2cc07fe371a61dfbd50a6b8095

@mui-bot
Copy link

mui-bot commented Nov 30, 2023

Netlify deploy preview

https://deploy-preview-40050--material-ui.netlify.app/

@material-ui/core: parsed: +0.09% , gzip: +0.13%
@material-ui/lab: parsed: +0.18% , gzip: +0.25%
@material-ui/system: parsed: +0.66% , gzip: +0.80%
@mui/material-next: parsed: +0.12% , gzip: +0.15%

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against f6567d7

@arronhunt arronhunt changed the title Fix/#34136 [mui-system] Fix darken() function Nov 30, 2023
@ZeeshanTamboli
Copy link
Member

ZeeshanTamboli commented Dec 23, 2023

@siriwatknp Can you review this? To me it seems like a breaking change for primary and secondary dark colors.

@siriwatknp
Copy link
Member

To me, this fix is a breaking change that should be considered in v7. What do you think @DiegoAndai ?

@siriwatknp siriwatknp added type: bug It doesn't behave as expected. breaking change Introduces changes that are not backward compatible. v7.x labels Feb 5, 2024
@DiegoAndai
Copy link
Member

Thanks, @arronhunt, for the contribution.

I agree with @siriwatknp and @ZeeshanTamboli. This would be perceived as a breaking change. v7, which is expected to bring design improvements, is the best time for this fix.

@DiegoAndai DiegoAndai added this to the Material UI: v7 draft milestone Feb 5, 2024
@oliviertassinari oliviertassinari added scope: system The system, the design tokens / styling foundations used across components. eg. @mui/system with MUI and removed package: material-ui labels Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Introduces changes that are not backward compatible. scope: system The system, the design tokens / styling foundations used across components. eg. @mui/system with MUI type: bug It doesn't behave as expected. v7.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[colorManipulator] Inconsistent output values with the darken function

7 participants