You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to change automatically choose the background color of a button when pressed. It shall darken the color if it is light, and lighten it if it's dark, and I think tinyColor could have this function.
It could just check the luminance/brightness of the color (like the L component of HSL) , and depending on it, darken() or lighten() by an amount.
Amount is how much it should change the L, threshold is how much L, from 0 to 100, it should choose to use darken or lighten.
Throwing out numbers without any test, x could be like 10, threshold maybe 50.
The text was updated successfully, but these errors were encountered:
SrBrahma
changed the title
In built way to Darken or lighten by amount depending on the color
In built way to automatically Darken or Lighten by amount depending on the color luminance
Oct 11, 2021
I want to change automatically choose the background color of a button when pressed. It shall darken the color if it is light, and lighten it if it's dark, and I think tinyColor could have this function.
It could just check the luminance/brightness of the color (like the L component of HSL) , and depending on it, darken() or lighten() by an amount.
It could be like
Amount is how much it should change the L, threshold is how much L, from 0 to 100, it should choose to use darken or lighten.
Throwing out numbers without any test, x could be like 10, threshold maybe 50.
The text was updated successfully, but these errors were encountered: