Sha256: 88dc69253078b16e23b36eb17b0e2a7ae856171e94ad9c41aee6411b94e73d2d

Contents?: true

Size: 1.06 KB

Versions: 3

Compression:

Stored size: 1.06 KB

Contents

@function powerNumber($number, $exp)
  $value: 1
  @if $exp > 0
    @for $i from 1 through $exp
      $value: $value * $number
  @else if $exp < 0
    @for $i from 1 through -$exp
      $value: $value / $number
  @return $value

@function colorLuminance($color)
  $color-rgb: ('red': red($color),'green': green($color),'blue': blue($color))
  @each $name, $value in $color-rgb
    $adjusted: 0
    $value: $value / 255
    @if $value < 0.03928
      $value: $value / 12.92
    @else
      $value: ($value + .055) / 1.055
      $value: powerNumber($value, 2)
    $color-rgb: map-merge($color-rgb, ($name: $value))
  @return (map-get($color-rgb, 'red') * .2126) + (map-get($color-rgb, 'green') * .7152) + (map-get($color-rgb, 'blue') * .0722)

@function findColorInvert($color)
  @if (colorLuminance($color) > 0.55)
    @return rgba(#000, 0.7)
  @else
    @return #fff

@function removeUnit($number)
  @if type-of($number) == 'number' and not unitless($number)
    @return $number / ($number * 0 + 1)
  @return $number

@function roundToEvenNumber($number)
  @return floor($number / 2) * 2

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bulma-rails-0.3.2 app/assets/stylesheets/sass/utilities/functions.sass
bulma-rails-0.3.1 app/assets/stylesheets/sass/utilities/functions.sass
bulma-rails-0.3.0 app/assets/stylesheets/sass/utilities/functions.sass