Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Commit

Permalink
Alpha color documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-chase committed Dec 7, 2015
1 parent d63cb6c commit 42d0feb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions _ibm-colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
//
// background: color('blue', 80); // #1d3649
// background: color('blue'); // #4178be
//
// background: color('blue', 80, $alpha: 0.5); // rgba(29, 54, 73, 0.5)
// background: color('blue', $alpha: 0.5); // rgba(65, 120, 190, 0.5)
//
//////////////////////////////
@function color($palette, $tone: 'core') {
@function color($palette, $tone: 'core', $alpha: 1) {
// Add a little helper so tone can be passed as single digit number
@if type-of($tone) == 'number' {
@if $tone % 10 == $tone {
Expand Down Expand Up @@ -43,7 +47,7 @@
$palette: 'warm-white';
}

@return map-get(map-get($__ibm-color-palettes, $palette), $tone);
@return rgba(map-get(map-get($__ibm-color-palettes, $palette), $tone), $alpha);
}

//////////////////////////////
Expand Down

0 comments on commit 42d0feb

Please sign in to comment.