mirror of https://github.com/nextcloud/calendar
Display custom color in calendar-grid
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
parent
8b872d207f
commit
f2577d4e2f
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue