Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. //YIQ Implementation
  2. @function yiq($color) {
  3. $red : red($color);
  4. $green: green($color);
  5. $blue : blue($color);
  6.  
  7. @return (($red*.299)+($green*.587)+($blue*.114));
  8. }
  9.  
  10. @function color-contrast($background, $dark:#000, $light:#fff) {
  11. @if yiq($background) >= 128 {
  12. @return $dark;
  13. } @else {
  14. @return $light;
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement