Tinting with color-mix()
Blend the background color into the contrast result to create branded text instead of pure black or white.
A word of caution:
contrast-color() picks the most contrasting color for you, but
color-mix() blends it back toward the background — at higher percentages
this can undo that benefit. Always verify your final result with a
contrast checker.
Sample text
Sample text
color: color-mix(in oklch, #6c1afb 15%, contrast-color(#6c1afb));