AtomMaterialUI / material-theme-issues

Issues Repository for the Material Theme UI plugin for JetBrains
Other
62 stars 4 forks source link

[Bug]: Cannot read user names on git blame due to inability to distinguish between light and dark backgrounds #517

Closed omrico closed 2 months ago

omrico commented 2 months ago

Describe the bug

Using Dracula Theme.

While using Git blame in Goland (Jetbrains), any highlighting of code-committer name is done in such a way that the text is always white (or very light) while the background is either light or dark. This causes inability to read the name of the committer. This can be easily calculated by something along those lines (this is a JS example, but take this as a base example):

calcTextColorGivenBgColor() {
   const rgb = [255,193,7]; // #FFC107
   const luminance = 0.2126 * parseInt(rgb[0], 10) / 255 + 0.7152 * parseInt(rgb[1], 10) / 255 + 0.0722 * parseInt(rgb[2], 10) / 255;

    if (luminance <= 0.5) {
      return '#fff'; // White text for dark backgrounds
    } else {
      return '#000'; // Black text for light backgrounds
    }
}

To Reproduce

Left click on line number, Annotate

Expected behavior

Light background should have dark text. Dark background should have light text.

Material Theme Version

8.13.2

IDE

Other (AppCode, CLion, GoLang...)

System Info

No response

Logs/Screenshots

See screenshot in comments
omrico commented 2 months ago
Screenshot 2024-05-25 at 09 04 58
mallowigi commented 2 months ago

will be fixed next release