Package io.didomi.sdk.common
Object ColorHelper
-
- All Implemented Interfaces:
public class ColorHelperHelper class used to do color related operations.
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringDEFAULT_COLORpublic final static StringDEFAULT_BACKGROUND_COLORpublic final static ColorHelperINSTANCE
-
Method Summary
Modifier and Type Method Description final StringgetOppositeColorString(String color)Compute a color from the contrast of the main access color (to ensure light on dark or dark on light) final IntegerparseColor(String colorString)Parse a color, supporting 3-characters color strings -
-
Method Detail
-
getOppositeColorString
final String getOppositeColorString(String color)
Compute a color from the contrast of the main access color (to ensure light on dark or dark on light)
- Parameters:
color- the base color
-
parseColor
@ColorInt() final Integer parseColor(String colorString)
Parse a color, supporting 3-characters color strings
- Parameters:
colorString- the color hex description, can be 3 or 6 characters
-
-
-
-