Skip to content

WIP: background: Add function to get color information about area of texture

Jonas Dreßler requested to merge verdre/mutter:add-color-get-info into main

Allow desktop environments showing text, icons or other information on top of the background image to determine the characteristics of the area used, so they can ensure the content has enough contrast.

The function takes the monitor index, the starting point and the size of the area to analyze as arguments and calculates the proportions of each primary color in the area, the area's mean luminance, the variance of the luminance and the mean acutance.

The calculation code was copied from elementary's wingpanel repository from the file wingpanel-interface/Utils.vala:

https://github.com/elementary/wingpanel/blob/master/wingpanel-interface/Utils.vala

Edited by Robert Mader

Merge request reports