1 2/*BaseColor*/ 3if (!window.WS) window.WS = {}; 4if (!window.WS.Util) window.WS.Util = {}; 5if (!window.WS.Util.Color) window.WS.Util.Color = {}; 6 7window.WS.Util.Color.HexaToRgba = function (Color) 8{ 9 // Validation 10 if (!Color) throw "Color cannot be null."; 11 if (!Color.Value && (Color.Value.replace("#", "").length != 3 || Color.Value.replace("#", "").length != 6)) throw "Color value cannot be null or invalid type."; 12 13 var CodeCode = Color.Value.replace("#", ""); 14 CodeCode = CodeCode.match(new RegExp('(.{' + CodeCode.length / 3 + '})', 'g')); 15 16 for (var i = 0; i < CodeCode.length; i++) { CodeCode[i] = parseInt(CodeCode[i].length == 1 ? CodeCode[i] + CodeCode[i] : CodeCode[i], 16); } 17 if (typeof Color.Opacity != 'undefined') CodeCode.push(Color.Opacity); 18 19 20 return "rgba(" + CodeCode.join(',') + ")"; 21}; 22 23window.WS.Util.Color.GetLinearGradient = function (Color) 24{ 25 // Validation 26 if (!Color) throw "Color cannot be null."; 27 if ((!Color.Angle && Color.Angle !== 0) || typeof Color.Angle !== "number") throw "Color angle invalid type (expected number)"; 28 29 var Colors = ""; 30 var ColorLen = Color.Colors.length; 31 for (var i = 0; i < ColorLen; i++) { Colors += WS.Util.Color.HexaToRgba(Color.Colors[i]) + (i < Color.Colors.length - 1 ? "," : ""); } 32 33 return "linear-gradient(" + Color.Angle + "deg," + Colors + ")"; 34};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.