An electronic device includes one or more processors; and memory storing one or more programs. The device receives an image of a light pattern. The light pattern is based on light reflected from a retina of an eye and includes an array of spots. The device determines a refraction value of the eye by analyzing locations of the array of spots in the image, and adjusts the display device based on at least the refraction value of the eye.