Skip to content

MonthViewRenderer._renderEvent doesn't use getContrastingTextColor #68

@thedhanawada

Description

@thedhanawada

Bug Description

`MonthViewRenderer._renderEvent()` (lines 103-111 in `src/renderers/MonthViewRenderer.js`) hardcodes `color: white` for event text:

```js
_renderEvent(event) {
const color = this.getEventColor(event);
return `


${this.escapeHTML(event.title)}

`;
}
```

Meanwhile, `BaseViewRenderer.renderTimedEvent()` correctly calls `this.getContrastingTextColor(color)` to compute readable text color.

Impact

  • Events with light background colors (e.g., yellow, light green, white) have white-on-light text — unreadable
  • Inconsistent behavior between month view events and week/day view events
  • Accessibility issue: fails WCAG contrast ratio requirements for light event colors

Expected Fix

Use `this.getContrastingTextColor(color)` instead of hardcoded `white`:
```js
const textColor = this.getContrastingTextColor(color);
// ... style="... color: ${textColor}; ..."
```

Files

  • `src/renderers/MonthViewRenderer.js:103-111`
  • Compare with `src/renderers/BaseViewRenderer.js:249` (correct usage)

Metadata

Metadata

Assignees

No one assigned

    Labels

    phase:0-foundationImmediate fixes and test infrastructurepriority:highImportant for next milestonetype:bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions