| 326 | this.handleResize(); |
| 327 | } |
| 328 | setColor(color) { |
| 329 | if (typeof color !== "string") color = ""; |
| 330 | let getColor = function(color) { |
| 331 | color = color.toLowerCase(); |
| 332 | if (color && /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(color)) { |
| 333 | if (color.length === 4) { |
| 334 | let rv = "#"; |
| 335 | for (let i = 1; i < 4; i++) { |
| 336 | rv += color.slice(i, i + 1) + color.slice(i, i + 1); |
| 337 | } |
| 338 | color = rv; |
| 339 | } |
| 340 | let rv = []; |
| 341 | for (let i = 1; i < 7; i += 2) { |
| 342 | rv.push(parseInt("0x" + color.slice(i, i + 2), 16)); |
| 343 | } |
| 344 | return rv.join(", "); |
| 345 | } |
| 346 | return null; |
| 347 | } |
| 348 | if (!color || getColor(color) === null) { |
| 349 | this.elements.parent.setAttribute("style", "--ejs-primary-color: 26,175,255;"); |
| 350 | return; |
| 351 | } |
| 352 | this.elements.parent.setAttribute("style", "--ejs-primary-color:" + getColor(color) + ";"); |
| 353 | } |
| 354 | setupAds(ads, width, height) { |
| 355 | const div = this.createElement("div"); |
| 356 | const time = (typeof this.config.adMode === "number" && this.config.adMode > -1 && this.config.adMode < 3) ? this.config.adMode : 2; |