Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The icons on the Unity launcher are square and contain the icon image and have a coloured background. The icons have different colours as their backgrounds (see screenshot). How does Unity decide what colour this should be?

Unity Launcher

share|improve this question
up vote 5 down vote accepted

Looks like it's using the average (RGB) of the colors of the icon.

Take a look at the upstream code for details.

share|improve this answer
So, what happens if the icon is monochrome? ;) – JanC Nov 12 '10 at 5:52
Well, the average of one white pixel and one black pixel is 50% neutral grey (127, 127, 127). ;-) And transparent pixels seem to count as black. – htorque Nov 12 '10 at 7:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.