Sha256: 51629c5a9e4c48953f83f22587724257faa8837be8b0918f8cdb75d585cb81c5
Contents?: true
Size: 716 Bytes
Versions: 12
Compression:
Stored size: 716 Bytes
Contents
// Computes the "brightness" of a color // // Brightness is similiar to lightness in HSL but more closely approximates // how humans perceive the intensity of the different RGB components of // a color. Brightness is sometimes called luminance. // // Returns a number between 0% and 100%, where 100% is fully bright // (white) and 0% is fully dark (black) for color values. // // For numbers and percentages it returns the same value to be used // in `@include filter(brightness(1.1))`. @function brightness($color) { @if type-of($color) == color { @return ((red($color) * .299) + (green($color) * .587) + (blue($color) * .114)) / 255 * 100%; } @else { @return unquote("brightness(#{$color})"); } }
Version data entries
12 entries across 12 versions & 3 rubygems