Merge branch 'master' of github.com:pipipi-pikachu/ppt_online_editor

This commit is contained in:
pipipi-pikachu 2021-04-18 11:37:06 +08:00
commit d3320f343c

View File

@ -30,16 +30,9 @@ export default defineComponent({
// 线 // 线
const gridColor = computed(() => { const gridColor = computed(() => {
if (!background.value || background.value.type === 'image') return 'rgba(100, 100, 100, 0.5)' const bgColor = background.value?.color || '#fff'
const color = background.value.color const colorList = ['#000', '#fff']
const rgba = tinycolor(color).toRgb() return tinycolor.mostReadable(bgColor, colorList, { includeFallbackColors: true }).setAlpha(.5).toRgbString()
const newRgba = {
r: rgba.r > 128 ? rgba.r - 128 : rgba.r + 127,
g: rgba.g > 128 ? rgba.g - 128 : rgba.g + 127,
b: rgba.b > 128 ? rgba.b - 128 : rgba.b + 127,
a: 0.5
}
return `rgba(${[newRgba.r, newRgba.g, newRgba.b, newRgba.a].join(',')})`
}) })
const gridSize = 50 const gridSize = 50
@ -80,5 +73,7 @@ export default defineComponent({
bottom: 0; bottom: 0;
right: 0; right: 0;
overflow: visible; overflow: visible;
z-index: 999;
pointer-events: none;
} }
</style> </style>