Skip to content

Commit

Permalink
convert: common/utils/stringToColor
Browse files Browse the repository at this point in the history
  • Loading branch information
dsevillamartin authored and franzliedke committed Jul 10, 2020
1 parent 20baa93 commit 455327c
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
function hsvToRgb(h, s, v) {
type RGB = { r: number; g: number; b: number };

function hsvToRgb(h: number, s: number, v: number): RGB {
let r;
let g;
let b;
Expand Down Expand Up @@ -51,11 +53,8 @@ function hsvToRgb(h, s, v) {

/**
* Convert the given string to a unique color.
*
* @param {String} string
* @return {String}
*/
export default function stringToColor(string) {
export default function stringToColor(string: string): string {
let num = 0;

// Convert the username into a number based on the ASCII value of each
Expand Down

0 comments on commit 455327c

Please sign in to comment.