32 lines
540 B
JavaScript
32 lines
540 B
JavaScript
import { red, blue, green, yellow, white, noColor } from "./config";
|
|
|
|
const getHex = (color) => {
|
|
let pointColor;
|
|
|
|
switch (color) {
|
|
case "red":
|
|
pointColor = red;
|
|
break;
|
|
case "blue":
|
|
pointColor = blue;
|
|
break;
|
|
case "green":
|
|
pointColor = green;
|
|
break;
|
|
case "yellow":
|
|
pointColor = yellow;
|
|
break;
|
|
case "white":
|
|
pointColor = white;
|
|
break;
|
|
case "blue":
|
|
default:
|
|
pointColor = noColor;
|
|
break;
|
|
}
|
|
|
|
return pointColor;
|
|
}
|
|
|
|
export default getHex;
|