nsISupports
Last changed in Gecko 17.0 (Firefox 17.0 / Thunderbird 17.0 / SeaMonkey 2.14)void findRepresentativeColor(in nsIURI imageURI, in mozIRepresentativeColorCallback callback); |
Given an image URI, find the most representative color for that image based on the frequency of each color. Preference is given to colors that are more interesting. It avoids the background color if it can be discerned and ignores sufficiently transparent colors.
This is intended to be used on favicon images. Larger images take longer to process, especially those with a larger number of unique colors. If imageURI points to an image that has more than 128^2 pixels, this method will fail for performance reasons before analyzing it.
void findRepresentativeColor( in nsIURI imageURI, in mozIRepresentativeColorCallback callback );
imageURI
callback
Below are some images with the result of findRepresentativeColor:
Image | Representative color | |
---|---|---|
0xB28D3A | ||
0x502E1E | ||
0x53BA3F | ||
0x00A400 |