style: be able to return more color names from calender view

This commit is contained in:
Asmita Hase 2025-02-20 15:21:04 +05:30
parent 62f90cb81d
commit 76be4a6c84

View file

@ -120,7 +120,6 @@ frappe.views.Calendar = class Calendar {
success: "green",
warning: "orange",
default: "blue",
notice: "yellow",
};
this.get_default_options();
}
@ -421,7 +420,8 @@ frappe.views.Calendar = class Calendar {
prepare_colors(d) {
let color, color_name;
if (this.get_css_class) {
color_name = this.color_map[this.get_css_class(d)] || "blue";
color_name = this.get_css_class(d);
color_name = this.color_map[color_name] || color_name || "blue";
if (color_name.startsWith("#")) {
color_name = frappe.ui.color.validate_hex(color_name) ? color_name : "blue";