Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
Updated 10 February 2017
Long time ago I had written a blog on “Changing background to image” using Palette support library. There I showed you how can we change our layout’s background color as per the Images we are getting from server. You can find it here.
Few days ago I was using this technique to get the visible text color to be shown on an image, but the problem was that I changed between different Swatches and even tried defining a region to the image so that I can get a visible color for my text. Despite trying everything, there was no success, then after a lot of search I came to know that the Palette library actually ignores all the white and black pixels from the image to get the correct value for the swatch and coincidently my image was a white dominant image and thats why I was not been able to get the results.
Actually Palette library applies a default filter while generating the Palette and you can remove that filter using “clearFilters()” method of “Palette.java” class.
And this simple step just solved my problem. You can also set your own Filters to the your palette using “addFilter()” method of Palette class.
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
Name
Email
Subject
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.