colors

Function for creating color wheels

This is something I've pseudo-solved many times and never quite found a solution that's stuck with me. The problem is to come up with a way to generate N colors that are as distinguishable as possible where N is a parameter....

Followup: Finding an accurate "distance" between colors

Original Question I am looking for a function that attempts to quantify how "distant" (or distinct) two colors are. This question is really in two parts: What color space best represents human vision? What distance metric in that space best represents human vision (euclidean?) ...

Followup: "Sorting" colors by distinctiveness

Original Question If you are given N maximally distant colors (and some associated distance metric), can you come up with a way to sort those colors into some order such that the first M are also reasonably close to being a maximally distinct set? In other words, given a bunch of distinct colors, come up with an ordering so I can use a...

ARBG to RGB

Let's say that we have an ARGB colorColor argb = Color.FromARGB(127, 69, 12, 255); //Light Urple. When this is painted on top of an existing color, the colors will blend. So blended with white, the resulting color is Color.FromARGB(255, 162, 133, 255); The solution should work like thisColor blend = Color.White; Color argb = Color.FromAR...

HSL in .net

What tools have you used for working with HSL colors in .net?...

Find out which colours are in use when using the MFC Feature pack in Office 2007 style

I'm updating some of our legacy C++ code to use the "MFC feature pack" that Microsoft released for Visual Studio 2008. We've used the new classes to derive our application from CFrameWndEx, and are applying the Office 2007 styles to give our application a more modern appearance. This gives us gradient filled window titles, status bars et...

What color scheme do you use for programming?

I get a lot of attention at work because I am the only one who bothered to change the default color settings in Visual Studio. I just modified them myself. I can provide the settings file if anyone cares to import it. Here's an example of how it looks. It reminds me of DOS/BASIC programming before I actually knew how to program. I al...

RGB to monochrome conversion

How do I convert the RGB values of a pixel to a single monochrome value? ...

Colorizing images in Java

I'm working on some code to colorize an image in Java. Basically what I'd like to do is something along the lines of GIMP's colorize command, so that if I have a BufferedImage and a Color, I can colorize the Image with the given color. Anyone got any ideas? My current best guess at doing something like this is to get the rgb value of eac...

Conditional formatting -- percentage to color conversion

What's the easiest way to convert a percentage to a color ranging from Green (100%) to Red (0%), with Yellow for 50%? I'm using plain 32bit RGB - so each component is an integer between 0 and 255. I'm doing this in C#, but I guess for a problem like this the language doesn't really matter that much. Based on Marius and Andy's answers I...

Generating gradients programatically?

Given 2 rgb colors and a rectangular area, I'd like to generate a basic linear gradient between the colors. I've done a quick search and the only thing I've been able to find is this blog entry, but the example code seems to be missing, or at least it was as of this posting. Anything helps, algorithms, code examples, whatever. This will ...

Web 2.0 Color Combinations

What are the most user-friendly color combinations for Web 2.0 websites, such as background, button colors, etc.? ...

How to change Instantiated Objects Font Colour in Visual Studio

Hello, I know the colours are changed in Environment > Fonts and Colors but I haven't found out which Display Item the object is. Can someone please tell how I can colour the following code: lblMessage.Text = "You have successfully answered my question!" I have the string coloured pink, I would like the lblMessage purple and the ...

Fighting programmer colors.

I have a couple of pet projects where I'm the sole designer/programmer and I spend too much time changing the user interface to make it easier to use by real users and avoiding bright yellow and green that is so common on "programmer" designs. Do you have tips to choose a color scheme when you do not have a graphics designer around? How...

Algorithm to randomly generate an aesthetically-pleasing color palette

I'm looking for a simple algorithm to generate a large number of random, aesthetically pleasing colors. So no crazy neon colors, colors reminiscent of feces, etc. I've found solutions to this problem but they rely on alternative color palettes than RGB. I would rather just use straight RGB than mapping back and forth. These other solut...

colored build output in Visual Studio

I am using a VS project with custom build script/batch file (ala make/ant etc) When the build is run from the command line we have placed colored highlighting on various output lines. However when built via Visual Studio (2005 in my case) the output window does not show the color anymore. Is this possible? I am quite happy to put sp...

Setting Colors in SWT.

This is pretty simple, I come from a swing/awt background. I'm just wondering what the proper way to set the background color for a SWT widget is? I've been trying: widget.setBackGround( ); Except I have no idea how to create the color Object in SWT? Thanks, Brian Gianforcaro ...

How to make Emacs terminal colors the same as Emacs GUI colors?

Hey folks, I program with Emacs on Ubuntu (Hardy Heron at the moment), and I like the default text coloration in the Emacs GUI. However, the default text coloration when Emacs is run in the terminal is different and garish. How do I make the colors in the terminal match the colors in the GUI? Thanks! ...

How can I change the text color in the windows command prompt

I have a command line program, which outputs logging to the screen. I want error lines to show up in red. Is there some special character codes I can output to switch the text color to red, then switch it back to white? I'm using ruby but I imagine this would be the same in any other language. Something like: red = "\0123" # characte...

Color reduction (in Java)

Hi! I would like to find a way to take JPEG (or GIF/PNG) images and reduce the amount of colors to e.g. 20. Could someone recommend some library or other reference? Also source codes in other languages are welcome. ...