If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Get the dominant color of the icon to use it when cold launching an application

NEW
Assigned to

Status

Firefox OS
Gaia::System
5 years ago
5 years ago

People

(Reporter: vingtetun, Assigned: etienne)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

That would be very cool if the background color of the splash could be synced with the icon dominant color. I have been told that Etienne would like to have fun with that :)
Hmm...that sounds quite similar to what we do with FxAndroid Web Apps. I'd suggest taking a look at their implementation as a point of reference.

I'm ccing wesj in case you have questions on that implementation.
(Assignee)

Comment 2

5 years ago
Created attachment 754233 [details]
Wip |getLaunchColor(icon)| function

Here's a wip |getLaunchColor(icon)| function.
(icon should be an image element)

Any pointer on where to look for the FxAndroid code / who could give me feedback on the math would be greatly appreciated :)
Attachment #754233 - Attachment mime type: application/javascript → text/plain
Gecko has a built in ColorAnalyzer.js that you should use if you can. I rolled our own in Java because it didn't exist at the time and bridging the xpcom and Java is non-trivial.

Its an xpcom component which may make it harder to use for you guys.

http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/ColorAnalyzer.js
http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/mozIColorAnalyzer.idl
You need to log in before you can comment on or make changes to this bug.