Skip to content

Instantly share code, notes, and snippets.

@DrMint
Last active November 20, 2022 15:23
Show Gist options
  • Save DrMint/e23054500db616de2ef7b23dc0da3932 to your computer and use it in GitHub Desktop.
Save DrMint/e23054500db616de2ef7b23dc0da3932 to your computer and use it in GitHub Desktop.
5-step gradient dithering between two given colors in CSS
: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);
}
@DrMint
Copy link
Author

DrMint commented Nov 20, 2022

Screenshot 2022-11-20 at 16-19-13 Welcome to Astro
Screenshot 2022-11-20 at 16-19-24 Welcome to Astro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment