summaryrefslogtreecommitdiffstats
path: root/web/react/utils
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-08-18 08:56:24 -0400
committerChristopher Speller <crspeller@gmail.com>2015-08-18 08:56:24 -0400
commit4805608cc9cf79277f37b94bbe38398816469884 (patch)
tree167962b7f56a4213dc0c945b33ed446fac9c5891 /web/react/utils
parent390cb47ec37c0bbddb829cae9cefeb8e0e97b7a1 (diff)
parentf68a8c8de3bbaf0179023e12da89c6f22f5b21a7 (diff)
downloadchat-4805608cc9cf79277f37b94bbe38398816469884.tar.gz
chat-4805608cc9cf79277f37b94bbe38398816469884.tar.bz2
chat-4805608cc9cf79277f37b94bbe38398816469884.zip
Merge pull request #391 from asaadmahmoodspin/master
Multiple UI changes
Diffstat (limited to 'web/react/utils')
-rw-r--r--web/react/utils/utils.jsx14
1 files changed, 14 insertions, 0 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 2312fe225..32793809d 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -857,6 +857,20 @@ module.exports.changeColor =function(col, amt) {
return (usePound?"#":"") + String("000000" + (g | (b << 8) | (r << 16)).toString(16)).slice(-6);
};
+module.exports.changeOpacity = function(oldColor, opacity) {
+
+ var col = oldColor;
+ if (col[0] === '#') {
+ col = col.slice(1);
+ }
+
+ var r = parseInt(col.substring(0, 2), 16);
+ var g = parseInt(col.substring(2, 4), 16);
+ var b = parseInt(col.substring(4, 6), 16);
+
+ return 'rgba(' + r + ',' + g + ',' + b + ',' + opacity + ')';
+};
+
module.exports.getFullName = function(user) {
if (user.first_name && user.last_name) {
return user.first_name + " " + user.last_name;