Skip to content

Commit

Permalink
Merge pull request #1 from alecmolloy/rgb+rgba
Browse files Browse the repository at this point in the history
Rgb+rgba
  • Loading branch information
alecmolloy authored Sep 1, 2016
2 parents 01e54ea + 55d3381 commit 55d2878
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
29 changes: 28 additions & 1 deletion lib/language/modules/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,31 @@ function rotate(color, amount) {
return Color(color).rotate(amount).rgbaString();
}

/*
* Rotate color hue by given amount
*
* @param {Number} red
* @param {Number} green
* @param {Number} blue
* @return {String}
*/
function rgb(red, green, blue) {
return "rgb(" + red + ", " + green + ", " + blue + ")";
}

/*
* Rotate alpha color hue by given amount
*
* @param {Number} red
* @param {Number} green
* @param {Number} blue
* @param {Number} alpha
* @return {String}
*/
function rgba(red, green, blue, alpha) {
return "rgba(" + red + ", " + green + ", " + blue + ", " + alpha + ")";
}

/*
* Get color opacity or set it to value if it's passed
*
Expand Down Expand Up @@ -233,9 +258,11 @@ module.exports = {
hue : hue,
setTransparency : setTransparency,
rotate : rotate,
rgb : rgb,
rgba : rgba,
opacity : opacity,
opacize : opacize,
transparentize : transparentize,
setBrightness : setBrightness,
setSaturation : setSaturation
};
};
1 change: 1 addition & 0 deletions lib/language/modules/palette.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
"steelblue" : "#4682B4",
"tan" : "#D2B48C",
"teal" : "#008080",
"transparent" : "rgba(0,0,0,0)",
"thistle" : "#D8BFD8",
"tomato" : "#FF6347",
"turquoise" : "#40E0D0",
Expand Down

0 comments on commit 55d2878

Please sign in to comment.