Last active
November 20, 2022 15:23
-
-
Save DrMint/e23054500db616de2ef7b23dc0da3932 to your computer and use it in GitHub Desktop.
5-step gradient dithering between two given colors in CSS
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
:root { | |
--dot-color-1: black; | |
--dot-color-2: white; | |
--bg-dot-0: var(--dot-color-2); | |
--bg-dot-25: conic-gradient(var(--dot-color-1) 25%, var(--dot-color-2) 25%) repeat center / 2px | |
2px; | |
--bg-dot-50: conic-gradient( | |
var(--dot-color-1) 25%, | |
var(--dot-color-2) 25%, | |
var(--dot-color-2) 50%, | |
var(--dot-color-1) 50%, | |
var(--dot-color-1) 75%, | |
var(--dot-color-2) 75% | |
) | |
repeat center / 2px 2px; | |
--bg-dot-75: conic-gradient(var(--dot-color-2) 25%, var(--dot-color-1) 25%) repeat center / 2px | |
2px; | |
--bg-dot-100: var(--dot-color-1); | |
} |
Author
DrMint
commented
Nov 20, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment