on 10-31-2017 5:00 PM
Hi,
I am using the UI5 theme parameters for Belize and I am wondering if there is a UI5 mechanism to determine whether a text color offers enough contrast on a certain background.
As an example, we have a gantt chart with labeled shapes using themes from the Fiori palette. If the Fiori palette changes tomorrow, we would like our labels to still be readable. Ideally, I would like something like this:
var myTextColor = @sapUiBaseText;
if (contrastAnalyzer(myTextColor, @sapUiChartPaletteQualitativeHue1) < @sapUiContentContrastTextThreshold) {
myTextColor = @sapUiContentContrastTextColor;
}
where @... parameters are retrieved using sap/ui/core/theming/Parameters.
Has anyone else encountered this situation and if so, would you share some example source code? Or would you suggest a different approach?
Thanks!
Bernard
Hi Bernanrd,
Doesn't the mix-blend-mode of CSS already does this for you?
If browser support is a must, please check this page as well for other techniques.
Regards,
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.