This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generates random string id | |
* | |
* @param prefix | |
* @param postfix | |
* @returns {string} | |
*/ | |
function generateId(prefix, postfix) { | |
prefix = prefix || ""; | |
postfix = postfix || ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Converts color code to RGB | |
//==================================== | |
function colorCodeToRGB(colorCode){ | |
var c; | |
var rgbaValidation = (/([R][G][B][A]?[(]\s*([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\s*,\s*([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\s*,\s*([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])(\s*,\s*((0\.[0-9]{1})|(1\.0)|(1)))?[)])/i.test(colorCode)) ; | |
var hexValidation = (/^#([A-Fa-f0-9]{3}){1,2}$/.test(colorCode)); | |
if(hexValidation){ | |
c= colorCode.substring(1).split(''); |
NewerOlder