Skip to content

Commit

Permalink
Use tinycolor's build-in hex conversion functionality instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Conroman16 committed Jan 21, 2020
1 parent 8b7c8d4 commit f1b352f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,7 @@ class ICMPPing extends q.DesktopApp {
{ color: this.getSlowColor(), pos: 1 } // from fast->slow when selecting colors
]);
// Calculate array of points on gradient for key colors and convert them to hex
return gradient.hsv(this.getGradientStops(), this.isXClockwiseGradient())
.map((el) => this.convertRgbToHex(Math.round(el._r), Math.round(el._g), Math.round(el._b)));
}

convertRgbToHex(r, g, b){
return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
return gradient.hsv(this.getGradientStops(), this.isXClockwiseGradient()).map((el) => el.toHexString());
}

isWindows(){
Expand Down

0 comments on commit f1b352f

Please sign in to comment.