| | |
| | | res.resetContrl = card.wrap.resetContrl || 'init' |
| | | |
| | | if (res.colorField && res.signs) { |
| | | res.signs = res.signs.map(item => { |
| | | res.signs = res.signs.map((item, i) => { |
| | | try { |
| | | let colors = item.color.match(/\d+/g) |
| | | let colors = item.background.match(/\d+/g) |
| | | if ((colors[0] * 0.299 + colors[1] * 0.578 + colors[2] * 0.114) * colors[3] < 192) { |
| | | item.fontColor = '#ffffff' |
| | | } else { |
| | |
| | | item.fontColor = '' |
| | | } |
| | | |
| | | item.style = {background: item.background} |
| | | if (item.fontColor) { |
| | | item.style.color = item.fontColor |
| | | } |
| | | |
| | | item.$index = i + 1 |
| | | |
| | | return item |
| | | }) |
| | | } |