GothenburgBitFactory / GothenburgBitFactory/taskwarrior
The `calendar` report is ignoring `rule.precedence.color` and `rule.color.merge` settings
- Dominant language
- C++
- Stars
- 6.1k
- Forks
- 423
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 11
Description
## Current behavior
The `calendar` report does not respect the `rule.precedence.color` or `rule.color.merge` settings as expected. At the same time, both the `taskrc` ([precedence](https://github.com/GothenburgBitFactory/taskwarrior/blob/develop/doc/man/taskrc.5.in#L1067-L1070), [merge](https://github.com/GothenburgBitFactory/taskwarrior/blob/develop/doc/man/taskrc.5.in#L881-L883)) and `task-color` ([precedence](https://github.com/GothenburgBitFactory/taskwarrior/blob/develop/doc/man/task-color.5.in#L267-L268), [merge](https://github.com/GothenburgBitFactory/taskwarrior/blob/develop/doc/man/task-color.5.in#L264-L265)) man pages lack any mention that they do not apply to the `calendar` report.
## Example
In the following example, I set `rule.precedence.color=scheduled,due` intending that dates with both `scheduled` and `due` tasks (e.g., November 22nd) would adopt the color defined for `scheduled` tasks. However, the color for that date defaults to the `due` task color instead of prioritizing `scheduled`.
Additionally, I set `rule.color.merge=0` to prevent blending of `scheduled` and `due` colors, but the colors are still merged.

## Analysis
A quick review of the source code for the `calendar` report reveals:
1. Precedence handling appears to be hardcoded, as seen [here](https://github.com/GothenburgBitFactory/taskwarrior/blob/98204b17a6b431ba660a6f1d9f21faf65a390d09/src/commands/CmdCalendar.cpp#L534), and depends on the order of `if` clauses
2. The `blend()` method from [libshared](https://github.com/GothenburgBitFactory/libshared/blob/47a750c385133dd14a0957691fe21cbe46e80b10/src/Color.cpp#L320) is used in [several places](https://github.com/GothenburgBitFactory/taskwarrior/blob/98204b17a6b431ba660a6f1d9f21faf65a390d09/src/commands/CmdCalendar.cpp#L544), disregarding the `rule.color.merge` setting
Contributor guide
Assessment
This issue has not been assessed yet.