Created
June 1, 2018 17:13
-
-
Save LeaVerou/cd721ce069e98cba4c757c659d1af3e6 to your computer and use it in GitHub Desktop.
The problem with brightness()
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
/** | |
* The problem with brightness() | |
*/ | |
body { | |
display: flex; | |
} | |
div { | |
width: 150px; | |
height: 150px; | |
background: hsl(210, 50%, 30%); | |
color: white; | |
padding: 25px; | |
} | |
div:nth-child(1) { | |
filter: brightness(250%); | |
} | |
div:nth-child(3) { | |
background: hsl(210, 50%, 80%); | |
} |
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>filter: brightness(250%)</div> | |
<div>original color</div> | |
<div>lightness *= 2.5</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