import { computed, ref, reactive } from 'vue'; import color from "../libs/function/color" import string from '../libs/function/string' export const useBackgroundColor = (backgroundColor: string) => { const state = reactive({ backgroundColorStyle: '', backgroundColorClass: '' }) state.backgroundColorStyle = color.getBackgroundColorStyle(backgroundColor) state.backgroundColorClass = color.getBackgroundColorInternalClass(backgroundColor) return state } export const useBackground = (props: any) => { return { backgroundColorStyle: computed(() => color.getBackgroundColorStyle(props.backgroundColor)), backgroundColorClass: computed(() => color.getBackgroundColorInternalClass(props.backgroundColor)) } } export const useFontColor = (fontColor: string) => { return { fontColorStyle: color.getFontColorStyle(fontColor), fontColorClass: color.getFontColorInternalClass(fontColor) } } export const useFontStyle = (fontSize: any, fontUnit: any) => { return ref(string.getLengthUnitValue(fontSize, fontUnit)) }