bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/whiteboard/annotations/helpers.js
Oleksandr Zhurbenko 251bd22738 PR review fixes
2017-09-06 12:36:52 -07:00

27 lines
475 B
JavaScript

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