Last active
June 1, 2018 18:24
-
-
Save LeaVerou/7f2ff9150c496e080e5731152288844a to your computer and use it in GitHub Desktop.
Converting between colors with filters
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
/** | |
* Converting between colors with filters | |
*/ | |
div div { | |
width: 200px; | |
height: 200px; | |
background: var(--color); | |
xfilter: grayscale() brightness(10000%); | |
} | |
body > div { | |
display: flex; | |
} | |
.fake div { | |
background: red; | |
} | |
.fake div:nth-child(1) { | |
filter: hue-rotate(81deg) saturate(43%) brightness(241%); | |
} | |
.fake div:nth-child(2) { | |
filter: hue-rotate(187deg) brightness(185%) saturate(69%); | |
} | |
.fake div:nth-child(3) { | |
filter: grayscale(100%) brightness(299%); | |
} |
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
<div> | |
<div style="--color: #75AF26; /* HSB: 85, 78%, 69% */"></div> | |
<div style="--color: #15B6D2 /* HSB: 189, 90%, 82% */"></div> | |
<div style="--color: hsl(0, 0%, 63%)"></div> | |
</div> | |
<div class="fake"> | |
<div></div> | |
<div></div> | |
<div></div> | |
</div> |
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
// alert('Hello world!'); |
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
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment