An ATproto social media client -- with an independent Appview.

fix: check by typeof

serenity 49cba1f7 48ce4c20

+4 -4
+4 -4
src/alf/util/colors/conversion.ts
··· 93 93 const g = hue(h) * 255 94 94 const b = hue(h - 1 / 3) * 255 95 95 96 - return `${appendSymbol ? '#' : ''}${r.toString(16)}${g.toString(16)}${b.toString(16)}${a ? a.toString(16) : ''}` 96 + return `${appendSymbol ? '#' : ''}${r.toString(16)}${g.toString(16)}${b.toString(16)}${typeof a !== 'undefined' ? a.toString(16) : ''}` 97 97 } 98 98 99 99 /** ··· 106 106 {r, g, b, a}: RgbColor, 107 107 appendSymbol: boolean = true, 108 108 ): HexCode => { 109 - return `${appendSymbol ? '#' : ''}${r.toString(16)}${g.toString(16)}${b.toString(16)}${a ? a.toString(16) : ''}` 109 + return `${appendSymbol ? '#' : ''}${r.toString(16)}${g.toString(16)}${b.toString(16)}${typeof a !== 'undefined' ? a.toString(16) : ''}` 110 110 } 111 111 112 112 /** ··· 165 165 h: h * 360, 166 166 s: s * 100, 167 167 l: l * 100, 168 - a: a ? (a / 255) * 100 : undefined, 168 + a: typeof a !== 'undefined' ? (a / 255) * 100 : undefined, 169 169 } 170 170 } 171 171 ··· 212 212 r: Math.round(r), 213 213 g: Math.round(g), 214 214 b: Math.round(b), 215 - a: a ? (a / 100) * 255 : undefined, 215 + a: typeof a !== 'undefined' ? (a / 100) * 255 : undefined, 216 216 } 217 217 }