rgb

How do I write a RGB color value in JavaScript?

I am trying to change the color of the function swapFE() below and I can't figure out how to write it. I was told to change the color of the phrase node to the color value (155, 102, 102). I tried to do that as you can see at the end of the function see- parent.childNodes[1].style.color= (155, 102, 102); but it just comes out a dark navy...

How to turn a SVG image to a SDL surface or an array of RGBA pixels with python?

I'm guessing it has to be done with the aid of some sort of framework. Google gives libCairo as the most common result, but that is way too many dependencies. I mean something that would work on Win/Lin/OSX, be non-GPL, python-compatible, freely re-distributable. And preferably a few hundred KB in size. Thing is, it doesn't even have t...

sorting colors in matlab

I have different RGB values in a 260000 * 3 dimension array. I wan to sort these colors in ascending or descending order (it does not matter which) so that similar colors are closer. What's the most efficient way to do this? ...

RGB Int to RGB - Python

How can I convert an RGB integer to the corresponding RGB tuple (R,G,B)? Seems simple enough, but I can't find anything on google. I know that for every RGB (r,g,b) you have the integer n = r256^2 + g256 + b, how can I solve the reverse in Python, IE given an n, I need the r,g,b values. ...

Magic COLORREF/RGB value to determine when to use light/dark text

Years ago, in my long lost copy of Charles Petzold's Windows 3.0 Programming book, there was a magic COLORREF or RGB value documented that you could use to check whether you should draw text in a light colour or a dark colour. E.g. if the background colour was below this value, then use black text, if it was higher, use white text. Doe...

UIColor not matching RGB

I have an image in Fireworks. I am using the picker to choose the color and then look at the RGB values. I am putting these values into UIColor:colorWithRed:green:blue:alpha but it is not giving me the same output. I am using values between 1.0 and 0.0. I am trying to get a dark blue color, the UIColor is giving me a very light blue. ...

Overlay Surface

Dear All What is overlay surface? I have to work currently on overlay surface and for which i should know the concept of overlay surface? As i have to wrok on converting YUV444->RGB888 Thanks in advance ...

Changing the tint of a bitmap while preserving the overall brightness

I'm trying to write a function that will let me red-shift or blue-shift a bitmap while preserving the overall brightness of the image. Basically, a fully red-shifted bitmap would have the same brightness as the original but be thoroughly red-tinted (i.e. the G and B values would be equal for all pixels). Same for blue-tinting (but with...

Converting rgb images to grayscale and renaming them using matlab

Hello, I have 500 images named Image1.tif all the way to Image500.tif and I need to convert all of them to grayscale and save them as Image1A.tif to Image500A.tif. Is there a quick way to do this? Thank you. ...

Why doesn't this Javascript RGB to HSL code work?

I found this RGB to HSL script over at http://www.mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript. I can't find any other small decent ones. The issue is that this code doesn't even really work. Would anybody know why? (I don't know a bit of color math, but maybe it's returning the complem...

HSL to RGB color conversion

Hi I am looking for a tool to convert between HSL color to RGB. HSL is not a very widely used so I am not having much luck googling for a converter. If you know of one, or an easily implementable algorithm it would be much appreciated. ...

Image conversion : RGBA to RGB

assuming i had RGBA (32 bits) output from frame-grabber, with alpha channel unused (values retained while filled by frame-grabbers), is there any effective conversion method to RGB (24 bits) ? I am dealing with 5 MegaPixels streaming images so speed does matter too. keep in mind that data in alpha channel can be discarded. ...

Actionscript 3.0 Translating HEX to ARGB

i'm studying getPixel32() and the Bitmap and Bitmap Data classes. Basically, i'd like to know how to output a simple trace of an ARGB from a hexadecimal value. as an aside, i'm under the impression, which i assume/hope is wrong, that hexadecimal values can't produce as many colors as RGBA values. perhaps "web safe" has thrown me off...

Algorithm to convert any positive integer to an RGB value

We have a heatmap we want to display. The numbers that will make up the values being displayed are unknown (except that they will be positive integers). The range of numbers is also unknown (again, except that they will be posiitive integars). The range could be between 0 and 200 or 578 and 1M or whatever. It depends on the data, which i...

PHP Work out colour saturation

Hi there, lets say i have the following RGB values: R:129 G:98 B:87 Photoshop says the saturation of that colour is 33% How would i work out that percentage using PHP and the RGB values? ...

Can we find out the difference between 2 RGb colors to find out a 3rd color?

2 colors are mixed together. If i have the RGB for the resultant color and RGB for one of the colors mixed, then somehow i could calculate the 2nd color? I will try to explain visually what i am trying to say. Here is a flickr link http://www.flickr.com/photos/48150615@N08/4407414157 I know that the circle in the middle has an opacity...

Conversion from YUV444 to RGB888

I am new in this field and i desperately need some guidance from u all. I have to support yuv444 to rgb 888 in display driver module. There is one test which i have done for yv12 rgb565 in wince 6.0 r3 which is mentioned below. //------------------------------------------------------------------------------ // // Function: PP_CS...

Convert System.Drawing.Color to RGB and Hex Value

Using C# I was trying to develop the following two. The way I am doing it may have some problem and need your kind advice. In addition, I dont know whether there is any existing method to do the same. private static String HexConverter(System.Drawing.Color c) { String rtn = String.Empty; try { rtn = "#" + c.R.ToStrin...

Convert RGB value to HSV

I've found a method on the Internet to convert RGB values to HSV values. Unfortunately, when the values are R=G=B, I'm getting a NaN, because of the 0/0 operation. Do you know if there is an implemented method for this conversion in Java, or what do I have to do when I get the 0/0 division to get the right value of the HSV? Here comes ...

Convert RGB color to CMYK?

Hi, I'm looking for an algorithm to convert an RGB color to CMYK. Photoshop is performing the conversion below: R = 220 G = 233 B = 174 C = 15 M = 0 Y = 40 K = 0 ...