winbox-ui-next
Version:
We Design Vue 2.0: A Vue.js 3 UI Library
20 lines (17 loc) • 519 B
JavaScript
/* eslint-disable @typescript-eslint/no-var-requires */
const {
getRgbStr,
} = require('@arco-design/arco-vue-scripts/src/plugins/winbox-color');
module.exports = {
install(_, __, functions) {
functions.add('get-rgb-str', (color) => {
return getRgbStr(color.value);
});
functions.add('get-var-str', (color) => {
if (color.value.indexOf('rgb') === 0) {
return color.value.replace(/rgb\((.*)\)/, '$1');
}
return getRgbStr(color.value);
});
},
};