colors

Changing Colours Dynamically in AS1

I can't get this to work in my AS1 application. I am using the Color.setTransform method. Am I correct in thinking the following object creation should result in transforming a colour to white? var AColorTransform = {ra:100, rb:255, ga:100, gb:255, ba:100, bb:255, aa:100, ab:255}; And this one to black? AColorTransform = {ra:100, rb:...

C# Application wide color management

Hi, im on to write a large C# Application. The point is that the colors of the controls should be adjustable by the user of the application. It would be really nice if there are any solution to override(only for the context of this application) the System.Drawing.SystemColors, so that i do not have to set the value of every single contro...

JQuery : adding 5 id's on the fly (instead of classes)

Hello guys, I'm dealing with this situation : I have a color animation script which targets by id (it's not JQuery but pure javascript) then I have a dynamic list without ids : 'ul' somePHP throwing list items '/ul' and finally I have JQuery itself (which I'll use to add several ids on the fly to the list items: but I still don't know...

Taking an RGB color and normalizing it with UIColor on the iPhone

Hey all, I'm looking for a straight forward way to convert a color from RGB, grabbing it from a tool like Photoshop, then convert it to a UIColor. Since UIColor uses normalized gamut of 0.0 to 1.0 for each color space, I'm not sure how this is done. Thanks for the solution. ...

Preventing Color Bleed when using Graphics.Drawstring()?

Hi, How do I prevent colors form bleeding into one another when using the vb .net Graphics.Drawstring method. This Occurs with colors that really shouldnt be used together eg green/orange and black and red. Thanks ...

Bipartite Graph (undirected)

I am taking an input, e.g. 4 1 3 1 2 2 4 First line is number of nodes, lines after that are the edges. I have to attempt to color the graph, and if I can't, I need to list a cycle in the graph that is causing the error. This is fine so far, except one of the graphs contains 1,000,000 nodes. Everytime I try to use it I get a Stack Ov...

Remove system colors from TcxDBColorCombobox

I have a TcxDBColorCombobox and I want the drop down to not include the system colors like clBtnFace, so it only includes colors like clRed. Additionally I would like it to include clWindow and clWindowText, but I can add those as custom colors if necessary. The process should be the same as for TcxColorCombobox. I am sure I will figu...

Python's PIL crop problem: color of cropped image screwed

Hi, I have a probably very basic problem with PIL's crop function: The cropped image's colors are totally screwed. Here's the code: >>> from PIL import Image >>> img = Image.open('football.jpg') >>> img <PIL.JpegImagePlugin.JpegImageFile instance at 0x00 >>> img.format 'JPEG' >>> img.mode 'RGB' >>> box = (120,190,400,415) >>> area = img...

How is the organization of the 12 Bit RGB color format?

Hello, I know that the 12 bit RGB color pallette format , has 4 bit for each color R,G,B. But how is the structure of the raw data i.e. 1.) Does each color have a byte corresponding to it which in turn has 4 padding bits , and 4 data bits for color data or 2.) Its a packed format , i.e. Byte-1= (padding bits + 4-Rbits) Byte-2 = ...

Convert grayscale value to RGB representation?

Hello, How can I convert a grayscale value (0-255) to an RGB value/representation? It is for using in an SVG image, which doesn't seem to come with a grayscale support, only RGB... Note: this is not RGB -> grayscale, which is already answered in another question) ...

jQuery - farbtastic PlugIn callback function

Hey! I'm just setting up a web page with a color picker. I choosed farbtastic. My problem is, that the callback function doesn't work. Here is the code I used: $('#colorPicker1').farbtastic('#background-color', function callback() { /*commands*/ }); The callback function is not called, when the user choosed a color. Does someone ha...

Multiple Strings colored in different way into the same cell of a JTable

Suppose you have a JTable and for each cell you want to display three strings with different color, say value1 (red), value2 (blue), value3 (green). I overrode the getTableCellRendererComponent of DefaultTableCellRenderer but setForeground(Color) method gives an unique color for all the string showed in the cell. @Override public Compo...

getting TableCellEditor colors to match match look and feel

So I have custom CellEditors and CellRenderers and although I am doing component.setForeground(isSelected ? table.getSelectionForeground() : table.getForeground()); component.setBackground(isSelected ? table.getSelectionBackground() : table.getBackground()); component.setOpaque(true); in my getTableCellRendererCompoent, the col...

Preserve ls colouring after grep'ing

If I do $ ls -l --color=always I get a list of files inside the directory with some nice colouring for different file types etc.. Now, I want to be able to pipe the coloured output of ls through grep to filter out some files I don't need. The key is that I still want to preserve the colouring after the grep filter. $ ls -l --color=...

HTML Newbie Question: Colored Background for Characters in Django HttpResponse

Hello, I would like to generate an HttpResponse that contains a certain string. For each of the characters in the string I have a background color I want to use. For simplification, let's assume I can only have shades of green in the background, and that the "background colors" data represents "level of brightness" in the green domain...

Dynamic coloring

Hi, any experience in changing a Widget's (background-) color dynamically? afaik I can only change the CSS style name but as the color is computed, I don't have a chance here? I found something like DOM.setStyleAttribute(mywidget.getElement(), "background", "#FF0000"); but that rather looks nasty. any ideas? ...

Generating color ranges in python

I want to generate a list of color specifications in the form of (r, g, b) tuples, that span the entire color spectrum with as many entries as I want. So for 5 entries I would want something like: (0, 0, 1) (0, 1, 0) (1, 0, 0) (1, 0.5, 1) (0, 0, 0.5) Of course, if there are more entries than combination of 0 and 1 it should turn to u...

Unique colors for each user

In my web app I have a chatroom. I wish to have each user's name to be colored differently rather than having them all black. What is the best way to achieve this? Should I store the RGB/HEX code for each user as they sign up to my app and put that string as a field as part of their record in the database? ...

Set the text color in a Java textbox

How does one set the color of text in a Java Swing textbox at run-time? At startup, the color is grayish and when the user enters the textbox, I wish to change the color to the normal text color. I am currently using the following code: private void txtScheduleInfoFocusGained(java.awt.event.FocusEvent evt) ...

Unable to make gray eol character by .vimrc

I want to have a gray eol character set by set list listchars=tab:>>,trail:$ where there are no spaces next to the character ":" I get no eol character for the above code if I use no spaces next to ":". I get a green trailing character if I use one space at - - tab:[space]>> -- although I have not set it up explicitly such tha...