Questions tagged [palette]

A helper class of Android to extract prominent colors from an image.

A helper class to extract prominent colors from an image.


Palette is an Android feature to support the developer to create a MaterialDesign feeling by generating a colorset of appropriate looking colors based on a bitmap source (app-icon e.g.).

Reference

359 questions
193
votes
11 answers

How to generate a number of most distinctive colors in R?

I am plotting a categorical dataset and want to use distinctive colors to represent different categories. Given a number n, how can I get n number of MOST distinctive colors in R? Thanks.
RNA
  • 146,987
  • 15
  • 52
  • 70
27
votes
2 answers

Can't set palette in bitmap

I have been writing a PCX decoder and, so far, the PCX image itself parses fine, but I can't work out how to set the palette of a bitmap. I have created a bitmap like so: Bitmap bmp = new Bitmap(width, height, …
user646265
  • 1,011
  • 3
  • 14
  • 32
25
votes
3 answers

How to reduce color palette with PIL

I'm not sure how I would go about reducing the color palette of a PIL Image. I would like to reduce an image's palette to the 5 prominent colors found in that image. My overall goal is to do some basic color sampling.
Andrew
20
votes
2 answers

Algorithm for color quantization/reduced image color palette in JavaScript?

I'm writing a web app that takes a user-submitted image, gets the pixel data via a canvas element, does some processing, and then renders the image using vector shapes (using Protovis). It's working well, but I end up with several thousand colors,…
nrabinowitz
  • 55,314
  • 10
  • 149
  • 165
20
votes
11 answers

How re-enable design palette in Android Studio

I recently made the switch to Android Studio as my default IDE for Android development. When designing my UI I normally use the palette in the design view to assist in arranging the widget on the preview screen.Recently something weird happened, It…
Joel Dean
  • 2,444
  • 5
  • 32
  • 50
19
votes
1 answer

How to get bitmap from URL using Coil?

I want to load a bitmap from URL and then use palette API to get some colors from that. On the documentation page, I cannot find the code for getting bitmap directly! Can anyone help me out?
Chintan Parmar
  • 2,375
  • 2
  • 12
  • 22
19
votes
4 answers

Qt Set Background Color of QLineEdit

I'm trying to change the background color of the QLineEdit and I can't figure it out at all. I tried using stylesheets originally like this QLineEdit *le = new QLineEdit(); le->setStyleSheet("background:#000;"); but that didn't do anything. I tried…
David Ludwig
  • 967
  • 2
  • 12
  • 26
19
votes
4 answers

is there a way to change the color palette for GGally::ggpairs using ggplot?

I would like to change the color palette for the GGally function ggpairs. When I attempt to add ggplot commands to the ggplot returned using getPlot, the colors do not change. my_pair_plot = ggpairs(dataset, color="var1") getPlot(my_pair_plot,2,1)…
Glenn Strycker
  • 4,816
  • 6
  • 31
  • 51
17
votes
1 answer

GIMP palette file (.gpl) format / syntax?

I'm looking for the exact specifications of this file format. Anyone got a link? Or want to comment? I have spent the better part of the day searching, yet I keep getting directed back to the GIMP online user-manual. It says "look at a .gpl file…
14
votes
8 answers

Gnuplot filledcurves with palette

I have been trying to change the fillstyle for the filledcurves option in gnuplot so that the fill colour represents the difference between the two curves on a 2-dimensional plot. I am thinking of this as an extension of the 'filledcurves…
atstack
  • 163
  • 1
  • 2
  • 6
13
votes
1 answer

Manually adding legend values in leaflet

I'm plotting results from various British elections in Leaflet and ran into a bit of a problem with legends. For the various results in the general election I'm using the same colour function with different domain for the different data (the…
Robert Hickman
  • 869
  • 1
  • 6
  • 22
13
votes
2 answers

How to define a color scheme in Xcode

I'd like to define a color scheme for my iOS project, in a way that it's easy to replace some colors. Let's say I have a "main" color and a "secondary" color, used in many elements in my app, and in a future I maybe want to set the "main" color to…
sonxurxo
  • 5,648
  • 2
  • 23
  • 33
12
votes
2 answers

PIL: Convert RGB image to a specific 8-bit palette?

Using the Python Imaging Library, I can call img.convert("P", palette=Image.ADAPTIVE) or img.convert("P", palette=Image.WEB) but is there a way to convert to an arbitrary palette? p = [] for i in range(0, 256): p.append(i, 0,…
mcccclean
  • 7,721
  • 10
  • 32
  • 36
10
votes
1 answer

how to add custom view to palette in android studio?

i made custom view which extend textView with this constractors : // Default constructor override public AutoResizeTextView(Context context) { this(context, null); } // Default constructor when inflating from XML file public…
Jesus Dimrix
  • 4,378
  • 4
  • 28
  • 62
9
votes
4 answers

java.lang.IllegalStateException: unable to getPixels(), pixel access is not supported on Config#HARDWARE bitmaps

I'm getting the vibrantSwatch color from bitmap using Palette. To get bitmap from uri before I wrote this code(In API 29 getBitmap has depricated) : Bitmap bitmap = MediaStore.Images.Media.getBitmap(context.getContentResolver(), …
Dnyaneshwar
  • 120
  • 1
  • 9
1
2 3
23 24