我正在使用一个名为#mapsvg 的插件。他们给了我这个 javascript 片段。我想要的是,用而不是纯色替换base
属性值。linear-gradiant
可能吗?
jQuery(document).ready(function () {
jQuery('#mapsvg').mapSvg({
markerLastID: 31,
width: 800,
height: '',
lockAspectRation: true,
colors: {
baseDefault: '#000000',
// background: 'linear-gradient(to right bottom, #7f00ff, #e100ff)',
selected: 40,
background: 'white',
hover: 'none',
directory: '#fafafa',
status: {},
base: '#8B5CF6',
},
viewBox: [0, 0, 1009.6727, 665.96301],
gauge: {
on: false,
labels: { low: 'low', high: 'high' },
colors: {
lowRGB: { r: 85, g: 0, b: 0, a: 1 },
highRGB: { r: 238, g: 0, b: 0, a: 1 },
low: 'yellow',
high: 'green',
diffRGB: { r: 153, g: 0, b: 0, a: 0 },
},
min: 0,
max: false,
},
source: '/mapsvg/maps/not-calibrated/world.svg',
title: 'World',
markers: marker,
responsive: true,
});
});