michaelevans / colorart Goto Github PK
View Code? Open in Web Editor NEWiTunes 11-style color matching code for Android
License: Apache License 2.0
iTunes 11-style color matching code for Android
License: Apache License 2.0
java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.ComparableTimSort.mergeLo(ComparableTimSort.java:710)
at java.util.ComparableTimSort.mergeAt(ComparableTimSort.java:447)
at java.util.ComparableTimSort.mergeCollapse(ComparableTimSort.java:372)
at java.util.ComparableTimSort.sort(ComparableTimSort.java:178)
at java.util.ComparableTimSort.sort(ComparableTimSort.java:142)
at java.util.Arrays.sort(Arrays.java:1973)
at java.util.Collections.sort(Collections.java:1867)
at org.michaelevans.colorart.library.ColorArt.findTextColors(ColorArt.java:154)
at org.michaelevans.colorart.library.ColorArt.analyzeImage(ColorArt.java:49)
at org.michaelevans.colorart.library.ColorArt.(ColorArt.java:44)
download ColorArt run mainActivity
ColorArt Application Sorry,ColorArt is stopping
.. If you do so, your markdown starts to show up properly)
Cooooooool library! =)
Also, I'm interested, do you use some kind of random heuristics points or just scan the whole bitmap to calculate most dominant colors? (so that the algorithm complexity is O(n^2) ?)
Same code, same bitmaps, but if you're to open app on android up to 4.4 and android 5.0 and more, achieved colors would differs a lot.
Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:28:9-36
is also present at [org.michaelevans.colorart:library:0.0.3] AndroidManifest.xml:12:9-35 value=(true).
Suggestion: add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml:23:5-58:19 to override.
Hi,
Not so much a bug, more a doc feature request. It would be useful to include some examples of using ColorArt to set the color of other Android UI elements.
E.g., see nikclayton/android-squeezer@6ba7f1d (lines 1310 onwards) for an example of how to adjust the colors on a ProgressBar (track, and thumb) based on the colors determined by ColorArt.
Best, N
It would be great to remove the dependency on the Apache commons collections, which is a fairly large library.
Any ideaa?
compile 'org.michaelevans.colorart:library:0.0.2'
It seems that the algorithm you're using has a tough time picking out reds. I'm using your library to pick out colors for albums and here is the first example of something going not as expected.
The background color is pretty good. It could be a little darker to reflect that the album background isn't pure white. My main issue is with the primary color here. There are pretty much only two colors on the album, white and red. The red doesn't show up in any of the colors, be it primary, secondary, or detail color. In all of these examples, the colors are as follows:
Here's another example
The background color is a dark brown/green. Ideally it would be a red or a white as those are the two most dominant colors in the image and they also touch the borders.
Yet another example:
For this album cover, the background color is good. What's weird is that the primary color is pink. There isn't really pink on the album cover, though there is a bit of red in the reflection of the sunglasses. It would make more sense for the primary color to be a black, white or brown.
Moar example:
There should be red/magenta as the primary color.
Last example:
Nix the purple/lilac. Use the reds/oranges/light blues/blacks or whites. The background color should definitely be white here as that is also the background color of the album. Red or orange would work as well.
EDIT:
I found some more weird occurrences. In the following image, there shouldn't be any light blue.
In the following image, there should not be pink.
In the future, similar to Chris Banes's ColorFinder, it would be nice to have a secondary text color which is either black or white depending on the brightness of the background color to ensure high visibility/readability.
I could trigger an NPE in findTextColors(), line 164
} else if (mSecondaryColor == null) {
NPE HERE => if (!isDistinctColor(mPrimaryColor, currentColor) ||
!isContrastingColor(currentColor, mBackgroundColor)) {
continue;
mPrimaryColor can be null, hence the NPE since isDistinctColor() expects an int as first parameter.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.