introducing fallback colors for very olf PVO versions
This commit is contained in:
@@ -96,10 +96,15 @@ export function generatePricescaleCSS(): string {
|
||||
const venueXML: I.VenueXML = config.state.inVenueXML!;
|
||||
const venuePricescalesArr: I.Pricescale2[] = venueXML.venue[0].pricescales[0].pricescale;
|
||||
|
||||
return venuePricescalesArr.map(arr => {
|
||||
return venuePricescalesArr.map((arr, i) => {
|
||||
const ID: string = arr.id[0];
|
||||
let color: string = `#${arr.color[0]} !important`; // Update: Colors are always defined: fallback colors exist in system so every XML provides them
|
||||
return `._${ID} { background-color: ${color}; }`;
|
||||
const color: string = arr.color[0];
|
||||
|
||||
// Update: Colors are always defined: fallback colors exist in system so every XML provides them
|
||||
// Update 2: Above is not true, since old PVO versions does NOT have default/fallback colors
|
||||
const colorCSS:string = color ? `#${color} !important` : `${config.fallbackColors[i]} !important`;
|
||||
|
||||
return `._${ID} { background-color: ${colorCSS}; }`;
|
||||
}).join("\r\n");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user