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

Version Path
arcabouco-0.2.13 vendor/bundle/gems/compass-core-1.0.3/stylesheets/compass/utilities/color/_brightness.scss
gem_2345-0.1.2 stylesheets/compass/utilities/color/_brightness.scss
compass-core-1.0.3 stylesheets/compass/utilities/color/_brightness.scss
compass-core-1.1.0.alpha.3 stylesheets/compass/utilities/color/_brightness.scss
compass-core-1.1.0.alpha.2 stylesheets/compass/utilities/color/_brightness.scss
compass-core-1.1.0.alpha.1 stylesheets/compass/utilities/color/_brightness.scss
compass-core-1.1.0.alpha.0 stylesheets/compass/utilities/color/_brightness.scss
compass-core-1.0.1 stylesheets/compass/utilities/color/_brightness.scss
compass-core-1.0.0 stylesheets/compass/utilities/color/_brightness.scss
compass-core-1.0.0.rc.1 stylesheets/compass/utilities/color/_brightness.scss
compass-core-1.0.0.rc.0 stylesheets/compass/utilities/color/_brightness.scss
compass-core-1.0.0.alpha.21 stylesheets/compass/utilities/color/_brightness.scss