Skip to content

Instantly share code, notes, and snippets.

@LeaVerou
Created June 1, 2018 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeaVerou/cd721ce069e98cba4c757c659d1af3e6 to your computer and use it in GitHub Desktop.
Save LeaVerou/cd721ce069e98cba4c757c659d1af3e6 to your computer and use it in GitHub Desktop.
The problem with brightness()
/**
* 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%);
}
<div>filter: brightness(250%)</div>
<div>original color</div>
<div>lightness *= 2.5</div>
// alert('Hello world!');
{"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