Theming Dynamic Text#

Two implementations. The first is based on color brightness obtained from- The second is based on relative luminance calculation for sRGB obtained from- and contrast ratio calculation obtained from-

Preliminary testing suggests color brightness more closely matches the Material Design spec suggested text colors, but the alternative implementation is both newer and the current ‘correct’ recommendation, so is included here as an option.

API - kivymd.theming_dynamic_text#

kivymd.theming_dynamic_text.get_contrast_text_color(color, use_color_brightness=True)#