Display custom color in calendar-grid

Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
Georg Ehrke 2020-02-25 13:02:13 +01:00
parent 8b872d207f
commit f2577d4e2f
No known key found for this signature in database
GPG Key ID: 9D98FD9380A1CB43
2 changed files with 5 additions and 3 deletions

View File

@ -92,10 +92,12 @@ export function eventSourceFunction(calendarObjects, calendar, start, end, timez
},
}
if (calendarObject.color) {
const customColor = getHexForColorName(calendarObject.color)
if (object.color) {
const customColor = getHexForColorName(object.color)
console.debug(customColor)
if (customColor) {
fcEvent.backgroundColor = customColor
fcEvent.borderColor = customColor
fcEvent.textColor = generateTextColorForHex(customColor)
}
}

View File

@ -111,7 +111,7 @@ export function detectColor(color) {
* Gets the HEX code for a css3 color name
*
* @param {string} colorName The name of the css3 color
* @returns {string|null} string of HEX if valid color, null if not
* @returns {String|null} string of HEX if valid color, null if not
*/
export function getHexForColorName(colorName) {
return css3Colors[colorName] || null