feat: 添加 颜色取反的功能
This commit is contained in:
@@ -320,6 +320,12 @@ function randomcolor () {
|
||||
return n()
|
||||
}
|
||||
|
||||
export {
|
||||
randomcolor
|
||||
function ColorReverse (OldColorValue) {
|
||||
const newValue = '0x' + OldColorValue.replace(/#/g, '')
|
||||
const str = '000000' + (0xFFFFFF - newValue).toString(16)
|
||||
return '#' + str.substring(str.length - 6, str.length)
|
||||
}
|
||||
export {
|
||||
randomcolor,
|
||||
ColorReverse
|
||||
}
|
||||
|
||||
@@ -649,7 +649,7 @@ import publicConfig from '@/components/common/rightBox/chart/publicConfig'
|
||||
import chartTypeShow from '@/components/common/rightBox/chart/chartTypeShow'
|
||||
import VueTagsInput from '@johmun/vue-tags-input'
|
||||
import draggable from 'vuedraggable'
|
||||
import { randomcolor } from '@/components/common/js/radomcolor/randomcolor'
|
||||
import { randomcolor, ColorReverse } from '@/components/common/js/radomcolor/randomcolor'
|
||||
export default {
|
||||
name: 'chartConfig',
|
||||
components: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import chartDataFormat from '@/components/charts/chartDataFormat'
|
||||
import { getUUID, resetZIndex } from '@/components/common/js/common'
|
||||
import { randomcolor } from '@/components/common/js/radomcolor/randomcolor'
|
||||
import { randomcolor, ColorReverse } from '@/components/common/js/radomcolor/randomcolor'
|
||||
const rz = {
|
||||
methods: {
|
||||
rz (e) {
|
||||
@@ -304,8 +304,8 @@ export default {
|
||||
value: undefined,
|
||||
display: '',
|
||||
color: {
|
||||
bac: bacColor,
|
||||
text: randomcolor()
|
||||
bac: bacColor + 'FF',
|
||||
text: ColorReverse(bacColor) + 'FF'
|
||||
}
|
||||
})
|
||||
this.change()
|
||||
|
||||
Reference in New Issue
Block a user