mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
Merge branch 'master' of github.com:pipipi-pikachu/ppt_online_editor
This commit is contained in:
commit
d3320f343c
@ -30,16 +30,9 @@ export default defineComponent({
|
||||
|
||||
// 计算网格线的颜色,避免与背景的颜色太接近
|
||||
const gridColor = computed(() => {
|
||||
if (!background.value || background.value.type === 'image') return 'rgba(100, 100, 100, 0.5)'
|
||||
const color = background.value.color
|
||||
const rgba = tinycolor(color).toRgb()
|
||||
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 bgColor = background.value?.color || '#fff'
|
||||
const colorList = ['#000', '#fff']
|
||||
return tinycolor.mostReadable(bgColor, colorList, { includeFallbackColors: true }).setAlpha(.5).toRgbString()
|
||||
})
|
||||
|
||||
const gridSize = 50
|
||||
@ -80,5 +73,7 @@ export default defineComponent({
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
overflow: visible;
|
||||
z-index: 999;
|
||||
pointer-events: none;
|
||||
}
|
||||
</style>
|
Loading…
x
Reference in New Issue
Block a user