tracktracker/src/front/map/common.js

31 lines
825 B
JavaScript

import color from "color";
/**
* Turn the main color of a line into a color suitable for using as a border.
* @param {string} mainColor Original color.
* @returns {string} Hexadecimal representation of the border color.
*/
export const makeBorderColor = mainColor => {
return color(mainColor).darken(0.2).hex();
};
/**
* Turn the main color of a line into a color suitable for using as a border.
* @param {string} mainColor Original color.
* @returns {string} Hexadecimal representation of the border color.
*/
export const makeCourseColor = mainColor => {
return color(mainColor).lighten(0.2).hex();
};
export const sizes = {
segmentOuter: 8,
segmentInner: 6,
stopRadius: 6,
stopBorder: 1.5,
courseSize: 15,
courseOuterBorder: 13,
courseBorder: 10,
courseInnerBorder: 7
};