Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(labels): font color #3330

Closed
blaryjp opened this issue Sep 17, 2018 · 2 comments
Closed

fix(labels): font color #3330

blaryjp opened this issue Sep 17, 2018 · 2 comments

Comments

@blaryjp
Copy link
Member

blaryjp commented Sep 17, 2018

Hello,

When we put a dark color, the font color is still dark, so we're unable to see what is written.

Possible solutions:

  • add a white shadow to the font
  • add the possibility to set the font color
  • add the possibility to use a "dark/light" dropdown to define the font color
  • ?

Thx

@yesnault
Copy link
Member

yesnault commented Sep 17, 2018

    self.getBrightness = function(rgb) {
      var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(rgb);
      return result ?
        0.2126 * parseInt(result[1], 16) +
        0.7152 * parseInt(result[2], 16) +
        0.0722 * parseInt(result[3], 16) : 0;
    };

    self.getBrightnessColor = function(rgb) {
      if (self.getBrightness(rgb) > 130) {
        return '#000000';
      }
      return '#ffffff';
    };

(from https://github.com/ovh/tatwebui/blob/master/client/src/app/shared/message-label/message-label.component.js#L58 )

@blaryjp
Copy link
Member Author

blaryjp commented Oct 2, 2018

@bnjjj up ; still annoying.. ; thx!

bnjjj added a commit that referenced this issue Oct 8, 2018
Signed-off-by: Benjamin Coenen <benjamin.coenen@corp.ovh.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants