//
// Copyright (c) 2018-present, Vonage. All rights reserved.
//

// // Calculeate brightness of a given color.
// @function brightness($color) {
// 	@return ((red($color) * .299) + (green($color) * .587) + (blue($color) * .114)) / 255 * 100%;
// }

// // Compares contrast of a given color to the light/dark arguments and returns whichever is most "contrasty"
// @function color-contrast($color, $dark: $black, $light: $white) {

// 	$color-brightness: brightness($color);
// 	$light-text-brightness: brightness($light);
// 	$dark-text-brightness: brightness($dark);

// 	@return if(abs($color-brightness - $light-text-brightness) > abs($color-brightness - $dark-text-brightness), $light, $dark);
// }

@function encode-hex-code($hex) {
    $hex: '#{$hex}';
    $hex: str-slice($hex, 2, str-length($hex));

    @return '%23' + $hex;
}
