I was wondering which function can i use from material ui to get its characteristic property of changing text color to either white or black in regard of blackground color, if bg is dark it changes color to white and if bg is light it changes color to black. exmaple
<AppBar color="primary">
<Toolbar>
<Typography color="inherit" > some text </Typography>
</Toolbar>
</AppBar>
now somehow if my primary color is a dark color MUI will automatically change my text color to white, and for light color will change to black.
which function or anything basically i can use to accomplish this functionality.
i tried a css property
mix-blend-mode: "difference"
but it doesn't give black/white like in MUI, It just gives a color with contrast that makes it visible.