— by Nesim
color-mix
is a new CSS function that allows you to mix two colors together in any desired color-space and ratio. It’s a powerful tool for creating color themes and palettes.
color-contrast
is another new CSS function that allows to compare the contrast ratio between one base color and one or more colors and return the color with the highest contrast ratio.
It currently is not supported in any browser :(
Links
CodePens
The following is only supported in Safari behind the color-contrast()
flag.
Browser support
- color-mix is safe to use in all modern browsers.
- color-contrast is not supported in any browser by default.