Skip to content

Configurable range selector active color #796

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

Merged
merged 4 commits into from
Aug 3, 2016

Conversation

etpinard
Copy link
Contributor

@etpinard etpinard commented Jul 29, 2016

resolves #790

This PR add a rangeselector attribute that sets the color of the active / hovered on range selector button.

This PR also add a new Color method called contrast that is used to determine the default active color given bgcolor. In brief, Color.contrast lightens dark colors and darken light colors using some tinycolor2's color manipulation methods.

TODO:

  • get @delekru 's approval the new Color.contrast function
  • agree on attribute name
  • add test for Color.contrast
  • add relayout test for activecolor

etpinard added 2 commits July 29, 2016 17:15
- making the color of the active / hovered button configurable
- by default, the 'activecolor' is set using Color.constrast
- fix test cases accordingly
@etpinard etpinard added this to the v1.16.0 milestone Jul 29, 2016
@etpinard
Copy link
Contributor Author

@delekru As of e2db213 Color.contrast gives:

with the default bgcolor (#eee):

image

with bgcolor: #fdae61 :

image

with bgcolor: #2b83ba:

image

That is, it lighten dark colors by 25% towards white and darkens light colors by 10% towards black.

@etpinard
Copy link
Contributor Author

@cldougl @chriddyp [re https://github.com//issues/790#issuecomment-235993820] I went with activecolor after all as this color is also used on hover - which isn't exactly the background (I think).

I think activecolor is unambiguous enough here. But, if you think otherwise please let me know.

@VeraZab
Copy link

VeraZab commented Aug 3, 2016

💃

@etpinard etpinard merged commit c45a2a0 into master Aug 3, 2016
@etpinard etpinard deleted the rangeselector-active-color branch August 3, 2016 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make range selector active button color settable
2 participants