diff options
author | Asaad Mahmood <Unknowngi@live.com> | 2015-08-18 11:58:15 +0500 |
---|---|---|
committer | Asaad Mahmood <Unknowngi@live.com> | 2015-08-18 11:58:15 +0500 |
commit | f68a8c8de3bbaf0179023e12da89c6f22f5b21a7 (patch) | |
tree | 39bcd4725e376cd708b7ff002847217e015a4c02 /web/react/utils | |
parent | a5bff83558c737645c4a3d516047403f69080c2d (diff) | |
download | chat-f68a8c8de3bbaf0179023e12da89c6f22f5b21a7.tar.gz chat-f68a8c8de3bbaf0179023e12da89c6f22f5b21a7.tar.bz2 chat-f68a8c8de3bbaf0179023e12da89c6f22f5b21a7.zip |
Multiple UI changes
Diffstat (limited to 'web/react/utils')
-rw-r--r-- | web/react/utils/utils.jsx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 7591c138f..0de40b40c 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -855,6 +855,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; |