palette

Qt Set Background Color of QLineEdit

…衆ロ難τιáo~ 提交于 2019-11-30 08:58:14
问题 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 using QPalette like this QPalette palette; palette.setColor(QPalette::Base, Qt::black); palette.setColor(QPalette::Background, Qt::black); le.setPalette(palette); but this didn't do anything either. I've been looking all day and can't find anything

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

 ̄綄美尐妖づ 提交于 2019-11-30 06:37:17
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) + scale_fill_brewer(palette = "Set2") Attempting to put ggplot commands directly on the ggpairs function results in an error. ggpairs(dataset, color="var1") + scale_fill_brewer(palette = "Set2") tonytonov Turns out, this is possible! It requires looking up the source code, but the solution comes up pretty easily. We are interested in ggpairs

Seaborn chart colors are different than those specified by palette

自作多情 提交于 2019-11-29 15:18:07
Why are seaborn chart colors different from the colors specified by the palette? The following two charts show the difference between the colors as they appear on a bar chart, and the colors as they appear in the palette plot. You can see if yo ulook carefully, that the colors on the bar chart are slightly less bright/saturated. Why are these different, and how can I get the bar chart to have the exact same colors as the ones specified in the palette? import seaborn as sns sns.set(style="white") titanic = sns.load_dataset("titanic") colors = ["windows blue", "amber", "greyish", "faded green",

Qt Set Background Color of QLineEdit

▼魔方 西西 提交于 2019-11-29 13:34:46
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 using QPalette like this QPalette palette; palette.setColor(QPalette::Base, Qt::black); palette.setColor(QPalette::Background, Qt::black); le.setPalette(palette); but this didn't do anything either. I've been looking all day and can't find anything. am I doing something wrong or is there another way to do it? Works fine for me: QLineEdit *le = new

Gnuplot filledcurves with palette

徘徊边缘 提交于 2019-11-29 07:46:48
问题 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 above/below' option whereby instead of just having two colours representing above or below there is a colour range or palette. Here is an example of the plot I would like to make from a datafile using the above/below filled curve style. A colourbar

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

别说谁变了你拦得住时间么 提交于 2019-11-29 06:16:37
问题 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) + scale_fill_brewer(palette = "Set2") Attempting to put ggplot commands directly on the ggpairs function results in an error. ggpairs(dataset, color="var1") + scale_fill_brewer(palette = "Set2") 回答1: Turns out, this is possible! It requires

Can't set palette in bitmap

我只是一个虾纸丫 提交于 2019-11-29 03:02:21
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, stride2, System.Drawing.Imaging.PixelFormat.Format8bppIndexed, pixels); But I can't seem to set the palette using the following method: for (int i = 0; i < 256; i += 3) { Color b = new Color(); b = Color.FromArgb(palette[i], palette[i + 1], palette[i + 2]); bmp.Palette.Entries.SetValue(b, i); } In this example, I have read through each byte in the palette of the pcx file and stored them

How to read 8-bit PNG image as 8-bit PNG image only?

倖福魔咒の 提交于 2019-11-28 12:53:47
I have a 8-bit PNG image (See the attachment). But when I read it using Image.FromFile method, the pixel format comes as 32-bit. Due to this I am unable to modify the palette. Please help me. See below for the code I am using to read the file and update the palette. public static Image GetPreviewImage() { Bitmap updatedImage = null; try { // Reads the colors as a byte array byte[] paletteBytes = FetchColorPallette(); updatedImage = Image.FromFile(@"C:\Screen-SaverBouncing.png"); ColorPalette colorPalette = updatedImage.Palette; int j = 0; if (colorPalette.Entries.Length > 0) { for (int i = 0;

PyQt5 控件学习(一个一个学习之QColorDialog)

做~自己de王妃 提交于 2019-11-28 05:18:55
QColorDialog的继承图: QColorDialog的描述: 它整体的功能都是和QFontDialog 差不多的。 QColorDialog的继承: 它继承自 QDialog QColorDialog的功能作用: from PyQt5.Qt import * #刚开始学习可以这样一下导入 import sys class Window(QWidget): def __init__(self): super().__init__() self.setWindowTitle("QColorDialog的学习") self.resize(400,400) self.set_ui() def set_ui(self): color = QColor(20,20,200) self.color = color colorDialog = QColorDialog(color,self) self.colorDialog = colorDialog self.test() def test(self): btn = QPushButton(self) btn.setText("按钮") btn.move(0,300) btn.clicked.connect(self.btn_clicked_slot) def btn_clicked_slot(self): self

Algorithm for color quantization/reduced image color palette in JavaScript? [closed]

雨燕双飞 提交于 2019-11-27 19:26:21
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, and I'd like to let the user pick a target palette size and reduce the color palette to that size. At the point where I want to reduce the color space, I'm working with an array of RGB pixel data, like this: [[190,197,190], [202,204,200], [207,214,210], [211,214,211], [205,207,207], ...] I tried the naive option of just removing least-significant