bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/whiteboard/annotations/helpers.js
Oleksandr Zhurbenko aa68421462 Fixed most of lint errors under components/whiteboard
Except annotation group, which will be changed soon
2017-08-19 23:32:01 -07:00

33 lines
535 B
JavaScript
Executable File

const colourToHex = (value) => {
let hex;
hex = parseInt(value, 10).toString(16);
while (hex.length < 6) {
hex = `0${hex}`;
}
return `#${hex}`;
};
const formatColor = (color) => {
let _color;
if (!color) {
_color = '0'; // default value
} else {
_color = color;
}
if (!_color.toString().match(/#.*/)) {
_color = colourToHex(_color);
}
return _color;
};
const getStrokeWidth = (thickness, slideWidth) => (thickness * slideWidth) / 100;
export default {
formatColor,
getStrokeWidth,
};