diff --git a/lib/language/modules/colors.js b/lib/language/modules/colors.js index b90eeb2c9..ddaac1219 100644 --- a/lib/language/modules/colors.js +++ b/lib/language/modules/colors.js @@ -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 * @@ -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 -}; \ No newline at end of file +}; diff --git a/lib/language/modules/palette.json b/lib/language/modules/palette.json index 5dfa3d09c..2cf513c92 100644 --- a/lib/language/modules/palette.json +++ b/lib/language/modules/palette.json @@ -137,6 +137,7 @@ "steelblue" : "#4682B4", "tan" : "#D2B48C", "teal" : "#008080", + "transparent" : "rgba(0,0,0,0)", "thistle" : "#D8BFD8", "tomato" : "#FF6347", "turquoise" : "#40E0D0",