Skip to content

Commit 4acf820

Browse files
a-haritibriangonzalez
authored andcommitted
refactor color ternary
1 parent 062a886 commit 4acf820

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/helpers.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ export const getCounts = (data: Uint8ClampedArray, ignore: string[]): [] => {
5454
// skip undefined data
5555
if (rgbComponents.indexOf(undefined) !== -1) continue
5656

57-
color = alpha && alpha !== 255
58-
? `rgba(${[...rgbComponents, alpha].join(',')})`
59-
: `rgb(${rgbComponents.join(',')})`
57+
color = `rgba(${(alpha && alpha !== 255
58+
? rgbComponents
59+
: [...rgbComponents, alpha]
60+
).join(',')})`
6061

6162
// skip colors in the ignore list
6263
if (ignore.indexOf(color) !== -1) continue

0 commit comments

Comments
 (0)