Skip to content

bug: Auto-contrast inconsistency causes unreadable white text on certain identical tag configurations #75

@BabakAmini

Description

@BabakAmini

When applying identical custom highlighting configurations with a background color of #ffff00 (bright yellow) across multiple tags, the automatic text foreground color algorithm behaves inconsistently.

For example, a tag named Bugs correctly resolves to a high-contrast black foreground color. However, as shown on line 66 of the attached screenshot, a tag named Temp using the exact same settings block renders an unreadable white foreground text instead. Changing the Temp tag name to other strings yields the same broken white-text behavior. The algorithm fails to calculate the correct high-contrast color depending on specific tag definitions.

Image

Here is my settings:

  "better-todo-tree.highlights.customHighlight": {
    "Bug": {
      "background": "#ffff00",
      "iconColour": "#ffff00",
      "icon": "bug",
      "type": "line"
    },
    "Temp": {
      "background": "#ffff00",
      "iconColour": "#ffff00",
      "icon": "x",
      "type": "line"
    },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions