Created
March 30, 2025 07:17
-
-
Save wchargin/9f768b33ac6af29802008315c5af9cc9 to your computer and use it in GitHub Desktop.
animate colors through a perceptual color space
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<style> | |
@property --fac { | |
syntax: "<percentage>"; | |
initial-value: 0%; | |
inherits: true; | |
} | |
html, | |
body { | |
height: 100%; | |
} | |
body { | |
background-color: color-mix(in oklch, blue, red var(--fac)); | |
animation: fac 5s linear infinite; | |
} | |
@keyframes fac { | |
0% { | |
--fac: 0%; | |
} | |
100% { | |
--fac: 100%; | |
} | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
demo: navigate to: