introducing fallback colors for very olf PVO versions

This commit is contained in:
zino
2021-06-10 13:56:08 +02:00
parent 1a788d16fd
commit d190314083
4 changed files with 30699 additions and 287 deletions

View File

@@ -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");
}