rgb

HSL in .net

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

RGB to monochrome conversion

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

IE6 - can't load a normal JPG

Try loading this normal .jpg file in Internet Explorer 6.0. I get an error saying the picture won't load. Try it in any other browser and it works fine. What's wrong? The .jpg file is just a normal picture sitting on the web server. I can even create a simple web page: <a href="http://www.zodiacwheels.com/images/wheels/blackout_thumb.jp...

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 ...

Read the rgb value of a given pixel in Python, Programaticly

If i open an image with open("image.jpg"), how can i get the rgb values of a pixel, if i have the 'coordinates' ( or co-ordinates?) of the pixel? Then how can i do the reverse of this? Starting with a blank graphic, 'write' a pixel with a certain rgb value? It would be so much better if i didn't have to download any additional librarie...

YUV Conversion via a fragment shader...

I have implemented a YUV to RGB conversion via a fragment shader written in Nvidia's shader language. (Y, U and V are stored in separate textures that are combined via multi texturing in my fragment shader). It works great under OpenGL, but under Direct3D I just can't get the output image to look right. I'm starting to suspect that Direc...

is there a perceptual DeltaRGB comparison of two colours (ie: like DeltaE2000)?

I was wondering if anyone knows of a reliable Delta RGB formula or code snippet that does colour Delta of the full RGB tri stim values, like how DeltaE 2000/cmc does Lab/Lch that takes perceptual differences into account?. The RGB Colourspace could be any but if it needed to be a particular one I could keep it sRGB for the calculations. ...

Converting hex to RGB and vice-versa

What is the most efficient way to do this? ...

C# Color constant R,G,B values

Where can I find a list of all the C# Color constants and the associated R,G,B (Red, Green, Blue) values? e.g. Color.White == (255,255,255) Color.Black == (0,0,0) etc... ...

RGB for color composition rather than primary hues

Why do computers use RGB (red, green, and blue) values for color composition rather than the primary hues, red, yellow, and blue? ...

How pick colors for a pie-chart?

I have some code that generates image of a pie chart. It's a general purpose class, so any number of slices can be given as input. Now I have problem picking good colors for the slices. Is there some algorithm that is good at that? Or maybe I should just hand-pick and list fixed colors? But how many. Maybe 10 colors and hope there will ...

Automatic YUV -> RGB in DirectShow for custom decoder

Hello everybody, after hours of searching on the net I'm quite desperate to find solution for this. I've up & running OGG Theora decoder in DirectShow which ouputs YV12 and YUY2 color models. Now, I want to make a RGB pixel manipulation filter for this output and to process it into video renderer. According to http://msdn.microsoft.com/...

Generate distinctly different RGB colors in graphs

When generating graphs and showing different sets of data it usually a good idea to difference the sets by color. So one line is red and the next is green and so on. The problem is then that when the number of datasets is unknown one needs to randomly generate these colors and often they end up very close to each other (green, light gree...

How to change RGB color to HSV?

How to change RGB color to HSV? In C# language. I search for very fast method without any external library. ...

Setting a font color in VBA

Hi. I want to set the font color of a cell to a specific RGB value. If I use ActiveCell.Color = RGB(255,255,0) I do get yellow, but if I use a more exotic RGB value like: ActiveCell.Color = RGB(178, 150, 109) I just get a grey color back. How come can't I just use any RGB value? And do you know any workarounds? Thanks. ...

how to decompose integer array to a byte array (pixel codings)

Hi sorry for being annoying by rephrasing my question but I am just on the point of discovering my answer. I have an array of int composed of RGB values, I need to decompose that int array into a byte array, but it should be in BGR order. The array of int composed of RGB values is being created like so: pix[index++] = (255 << 24) | (r...

Programmatically choose high-contrast colors

This should be a simple question, but I haven't been able to find a way to make it work. Essentially, I have a silly localhost page that I use in my webdevelopment. When I am surfing between our development server and my local version of the C# code (redirected from the dev url via host file) I have been known to sometimes forget what ...

How to get RGB values from UIColor?

Im creating a color object using the following code. curView.backgroundColor = [[UIColor alloc] initWithHue:229 saturation:40 brightness:75 alpha:1]; How can I retrieve RGB values from the created color object? ...

How to pull out the ARGB component from BitmapContext on iPhone?

I'm trying to get ARGB components from CGBitmapContext with the following codes: -(id) initWithImage: (UIImage*) image //create BitmapContext with UIImage and use 'pixelData' as the pointer { CGContextRef context = NULL; CGColorSpaceRef colorSpace; int bitmapByteCount; int bitmapBytesPe...