Patent attributes
In implementations of contrast-ratio-based color generation, a user interface displays on a display device of a computing device, where the user interface includes a background color and content colors of content displayed in the user interface. A color generation module implemented by the computing device receives input that changes the background color in the user interface. The color generation module can then calculate a brightness value of the background color, calculate target contrast ratios of the respective content colors based on the brightness value of the background color, generate color values for new content colors based on the calculated target contrast ratios of the respective content colors, calculate respective brightness values of the new content colors based on the generated color values for the new content colors, and adjust a saturation and hue of the new content colors based on the calculated respective brightness values of the new content colors.