Skip to content

Instantly share code, notes, and snippets.

@coding-horror
Created January 23, 2015 21:11
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 coding-horror/96d0d256bc090bcb98e6 to your computer and use it in GitHub Desktop.
Save coding-horror/96d0d256bc090bcb98e6 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div class="bg">Hello</div>
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
$success: #009900;
$secondary: #ffffff;
div {
background-color: dark-light-diff($success, $secondary, 50%, -35%);
width:300px;
height: 50px;
font-weight: bold;
color: #919191;
}
@function bleh($input) {
@return $input;
}
@function dark-light-diff($adjusted-color, $comparison-color, $lightness, $darkness) {
@if brightness($adjusted-color) < brightness($comparison-color) {
@return scale-color($adjusted-color, $lightness: $lightness)
} @else {
@return scale-color($adjusted-color, $lightness: $darkness)
}
}
div {
background-color: dark-light-diff(#009900, #ffffff, 50%, -35%);
width: 300px;
height: 50px;
font-weight: bold;
color: #919191;
}
<div class="bg">Hello</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment