(params: any)
| 51 | strokeWidth: number; |
| 52 | |
| 53 | constructor(params: any) { |
| 54 | this.type = params.type || "wave"; |
| 55 | this.section = params.section || "header"; |
| 56 | this.height = Number(params.height) || 120; |
| 57 | this.text = params.text || ""; |
| 58 | this.desc = params.desc || ""; |
| 59 | this.textBg = params.textBg == "true"; |
| 60 | this.fontSize = Number(params.fontSize) || 70; |
| 61 | this.fontColor = params.fontColor; |
| 62 | this.fontFamily = |
| 63 | params.fontFamily || |
| 64 | "-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji"; |
| 65 | this.fontAlign = parseToNumberArr(params.fontAlign || ""); |
| 66 | this.fontAlignY = parseToNumberArr(params.fontAlignY || ""); |
| 67 | this.textBgColor = params.textBgColor || "000000"; |
| 68 | this.stroke = params.stroke || (params.strokeWidth ? "B897FF" : "none"); |
| 69 | this.strokeWidth = |
| 70 | Number(params.strokeWidth) || (params.stroke === "none" ? 0 : 1); |
| 71 | this.descSize = Number(params.descSize) || 20; |
| 72 | this.descAlign = Number(params.descAlign) || 50; |
| 73 | this.descAlignY = Number(params.descAlignY) || 60; |
| 74 | this.descColor = params.descColor || "000000"; |
| 75 | this.animation = params.animation || "fadeIn"; |
| 76 | this.reversal = checkReversal(params.reversal || "false"); |
| 77 | this.rotate = Number(params.rotate) || 0; |
| 78 | this.customColorList = params.customColorList || ""; |
| 79 | this.theme = params.theme || "none"; |
| 80 | this.color = params.color || "B897FF"; |
| 81 | |
| 82 | // Something needs improvement.. |
| 83 | if (this.theme !== "none" && checkThemeColor(this.theme)) { |
| 84 | [this.color, this.fontColor, this.textBgColor] = generateThemeColor( |
| 85 | this.theme, |
| 86 | ); |
| 87 | this.descColor = this.textBgColor; |
| 88 | } else { |
| 89 | if (this.color === "auto") { |
| 90 | [this.color, this.fontColor, this.textBgColor] = generateAutoColor( |
| 91 | this.fontColor, |
| 92 | this.customColorList, |
| 93 | ); |
| 94 | } else if (this.color === "gradient") { |
| 95 | [this.color, this.fontColor, this.textBgColor] = generateAutoGradient( |
| 96 | this.fontColor, |
| 97 | this.customColorList, |
| 98 | ); |
| 99 | } else if (this.color === "timeAuto" || this.color === "timeGradient") { |
| 100 | [this.color, this.fontColor, this.textBgColor] = generateAutoByTime( |
| 101 | this.color, |
| 102 | this.fontColor, |
| 103 | ); |
| 104 | } else { |
| 105 | this.color = checkCustomColor(this.color); |
| 106 | } |
| 107 | this.descColor = this.fontColor; |
| 108 | } |
| 109 | |
| 110 | if (isGradientColor(this.color)) { |
nothing calls this directly
no test coverage detected