1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00
chess/assets/css/vendor/bourbon/bourbon/utilities/_contrast-ratio.scss
Dan Barber bedd6605ef
Redesign whole site in B&W
* Forms and board tweaks for small screen sizes
* Re-style game status indicators
* Re-style viewing/offline indicator
* Better eyecons 👁
* Re-organise CSS according to ITCSS principles
* Pick new font from Google Fonts
* Fix up tests
* Move some things into partials
2018-09-16 14:02:52 -04:00

32 lines
740 B
SCSS

@charset "UTF-8";
/// Programatically determines the contrast ratio between two colors.
///
/// Note that the alpha channel is ignored.
///
/// @link https://goo.gl/54htLV
///
/// @argument {color (hex)} $color-1
///
/// @argument {color (hex)} $color-2
///
/// @return {number (1-21)}
///
/// @example scss
/// _contrast-ratio(black, white)
///
/// @require {function} _lightness
///
/// @access private
@function _contrast-ratio($color-1, $color-2) {
$-local-lightness-1: _lightness($color-1) + 0.05;
$-local-lightness-2: _lightness($color-2) + 0.05;
@if $-local-lightness-1 > $-local-lightness-2 {
@return $-local-lightness-1 / $-local-lightness-2;
} @else {
@return $-local-lightness-2 / $-local-lightness-1;
}
}