1. A system comprising: a processor and a memory; and a module configured to cause the processor to: receive an image of a user interface element, wherein the image comprises a plurality of pixels; transform the image to a grayscale representation of the image; create a histogram from the grayscale representation of the image; determine a first maximum on the histogram, the first maxima corresponding to a background of the image; select a second maximum farthest from the first maximum corresponding to the background of the image, the second maximum comprising a maximum corresponding to text of the image; perform a reverse look-up of the first maximum to determine a color model value for the background of the image; perform a reverse look-up of the second maximum to determine the color model value for the text of the image; and calculate a luminosity ratio, the luminosity ratio comprising a ratio of a luminosity for the color model value for the background of the image to a luminosity for the color model value for the text of the image.