const colorModule = require("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. */ const makeBorderColor = mainColor => { const hsl = colorModule(mainColor).hsl(); hsl.color = Math.max(0, hsl.color[2] -= 20); return hsl.hex(); }; exports.makeBorderColor = makeBorderColor; /** * 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. */ const makeCourseColor = mainColor => { const hsl = colorModule(mainColor).hsl(); hsl.color = Math.max(0, hsl.color[2] += 10); return hsl.hex(); }; exports.makeCourseColor = makeCourseColor; const sizes = { segmentOuter: 8, segmentInner: 6, stopRadius: 6, stopBorder: 1.5, courseSize: 15, courseOuterBorder: 13, courseBorder: 10, courseInnerBorder: 7 }; exports.sizes = sizes;