colors

Find Colour Range

I want to find a range of colours from the value of one RGB value If I was given rgb(0,100,200) for example it would give me everything between rgb(0,0,255) and rgb(0,255,255). However not rgb(255,0,255). Similarly rgb(150,50,0). Return: rgb(255,0,0) and rgb(255,255,0). Not rgb(255,0,255). Making sense? Im using PHP ...

Color Interpolation Between 3 Colors in .NET

I would like to smoothly interpolate color from Color A (let's call it red) to Color C (let's call it green) going through color B (let's call it yellow), based on the value of a certain variable. If the variable = 100, I want pure green. If the variable = 50, I want pure yellow. If the variable = 0, I want pure red. I understand you c...

GTK: Modify bg color of a CheckButton

I tried the following, yet the button still has a white background: self.button = gtk.CheckButton() self.button.modify_fg(gtk.STATE_NORMAL, gtk.gdk.Color(65535,0,0)) self.button.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(65535,0,0)) self.button.modify_fg(gtk.STATE_ACTIVE, gtk.gdk.Color(65535,0,0)) self.button.modify_b...

GTK: create a colored regular button

How do I do it? A lot of sites say I can just call .modify_bg() on the button, but that doesn't do anything. I'm able to add an EventBox to the button, and add a label to that, and then change its colors, but it looks horrendous - there is a ton of gray space between the edge of the button that doesn't change. I just want something that ...

In GTK on Windows, how do I change the background color of the whole app?

According to http://www.pygtk.org/docs/pygtk/gtk-constants.html, there are five state types: STATE_NORMAL, STATE_INSENSITIVE, etc. I want to set the background color of a Table, HBox, VBox, whatever, and I've tried setting every possible color of every kind of state: style = self.get_style() for a in (style.base, style.fg, style...

Changing the color of a font and making it underlined

I need to make a font underline and blue for a hyperlink in one of my JButtons, but it seems the font class has no obvious way to do this. I can't use attributedtext because I'm not going to be displaying this with Graphics class. Is there anyway I can accomplish this? I just need the title of my JButton to be blue and underlined. ...

How can I highlight a row in a gtk.Table?

I want to highlight specific rows in a gtk.Table. I also want a mouseover to highlight it w/ a different color (like on a link in a web browser). I thought of just packing each cell with an eventBox and changing the STATE_NORMAL and STATE_PRELIGHT bg colors, which does work, but mousing over the eventbox doesn't work. Is there a better w...

What's the point of alloc_color() in gtk?

Various examples always use alloc_color() and stuff like gtk.color.parse('red'), etc. I just do gtk.gdk.Color(65535,0,0), and that seems to work. What's the need for alloc_color? ...

Configuring the colors of Eclipse

Since there is no easy way to switch color theme in Eclipse I'm wondering if there are any themes that have documented their colors. Kind of like this: Background: #000000 brackets: #FFEFC6 So i manually can configure the theme without having to mess around with a color picker. I need a dark theme similar to TextMates vibrant theme. ...

I want different colours in my C# webform textbox!

I want to format lines of text differently in a .net C# webforms text box, eg. some lines italic or different colour? I know I can in windows forms, is there a richtextbox alternative for webforms? I find a lot of people asking but no answer...please can you help? ...

To get colors to Less in Ubuntu's Zsh

How can you get similar highlightings to Zsh's Less than Bash's Less in Ubuntu? I switched from OS X to Ubuntu. My Less do not work as expected in Zsh. Manuals in my Less are green and black with or without the following code. # comment these out in Ubuntu export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking exp...

Changing the color of a text box depending on its content

I have in a VS2005 C++ Form application a table adapter and a Text box that displays data from a specific column. What I want to do is to have its color changed on whether the content is >0 or <0. I tried adding this: if(this->CSumTextBox->TabIndex<0) { this->CSumTextBox->ForeColor = System::Drawing::Color::Red; } But it doesn't ...

Sorting by Color

I have a long list (1000+) of hex colors broken up in general color categories (Red, Orange, Blue, etc). When I show the list of colors in each category I need to show them in order of shade. i.e. light red first and dark red last. What would the algorithm be to do this? (googling has failed me) ...

In a UIImage (or its derivatives), how can I replace one color with another?

For example, I have a UIImage (from which I can get a CGImage, CGLayer, etc., if needed), and I want to replace all of the red pixels (1, 0, 0) with blue (0, 0, 1). I have code to figure out which pixels are the target color (see this SO question & answer), and I can substitute the appropriate values in rawData but (a) I'm not sure how ...

Loupe Magnification with White Text & Clear Background on Iphone

You guys helped so much with my last question, I figured I'd give you a shot at another. I have written an app with a theme that uses a dark blue glassy background and white / gray text and labels. The textfields in my app have clearcolor backgrounds and white texts and everything shows up very well. My only concern is that when you hold...

How do I set the next available custom color in the ColorDialog?

I'm currently coding in VB.net. A user places the cursor in a table cell and clicks on "Table > Background Color" to edit the current background colour. Currently I have been able to detect the current colour (for instance a light blue) and set that colour in the ColorDialog (Colour swatches are correct and RGB values are correct). Wh...

How can I find out the current color depth of a machine running vista/w7?

Hi! I want to check the current color depth of the OS to warn users if they try to run my application with a "wrong" color depth (using c++ & Qt). I guess there's a win api call to get this information, but I couldn't find anything... Thaks for any hint, Hannes ...

Algorithm to map Numbers to Hex Colors

Hi all, Here's my situation. Say I have two columns of data containing different elements. I'd like to highlight with a different color, all matching elements between those two columns. Each of those elements has an ID, so I was thinking of creating a mapping function to tie an ID to a hex color. Any suggestions? This is what I...

Generating Color Gradients

I had an idea to programmatically generate matching color schemes however I need to be able to generate a linear gradient given a set of two colors (Hex or RGB values). Can anyone provide me the (pseudo-)code or point me in the right direction to accomplish this task? EDIT: I forgot to mention, but I also need to specify (or know) the ...

How does one make logging color in Django/Google App Engine?

If one iswriting a Django/ Google App Engine application and would like to have logs that are conveniently conspicuous based on color (i.e. errors in red), how does one set that up? I've copied the helpful solution from this question, but I'm not sure how to integrate it into Django/Google App Engine. I figured one would put the follow...