colors

Programmatically obtaining the number of colors used in an image

Question: Given an image in PNG format, what is the simplest way to programmatically obtain the number of colors used in the image? Constraints: The solution will be integreted into a shell script running under Linux, so any solution that fits in such an environment will do. Please note that the "color capacity of the image file" ...

How to change the color of some text in textbox - Silverlight 3?

Hello, I have a usual TextBox. I know in order to change the color of some text I can use Run tag. But when I try to use it imperatively instead declaratively (because I need to do that dynamically) I have the text in TextBox like AAA<Run...>Text to be changed in color</Run> and sure nothing in color changes. How can I change the col...

"Distance" between colours in PHP

I'm looking for a function that can accurately represent the distance between two colours as a number or something. For example I am looking to have an array of HEX values or RGB arrays and I want to find the most similar colour in the array for a given colour eg. I pass a function a RGB value and the 'closest' colour in the array is r...

Changing MFMailComposeViewController's toolbar color

I'm using a tinted navigation bar and a tinted global UIToolbar in my iPhone app. In my info view, I have a button which opens a MFMailComposeViewController, and the toolbar at the top of that view (with the "cancel" and "send" button) is still blue. I'm calling the MFMailComposeViewController like this: -(void)displayMailSheet { MFM...

how to identify a given string is hex color format

I'm looking for a regular expression to validate hex colors in asp.net C#. and also looking code for validate in server side For instance: #CCCCCC ...

does netbeans support coloring for .sh (bash) scripts?

I use netbeans 6.8 beta and when i load .sh (bash) file it's not colored at all. i can add a new file association for the .sh extension but it doesn't seem that there is a known associated mime type. ...

conditional change of a datagridviews cell background color and text

This is for a winform vb.net 2008 app. I'm bringing data back from a database and based on some static conditions... i want to change the color of the background and the text. There is no rowdatabound event in winform... hope someone can provide some guidance thanks shannon ...

Changing the background color of a paragraph in JTextPane (Java Swing)

Is it possible to change the background color of a paragraph in Java Swing? I tried to set it using the setParagraphAttributes method (code below) but doesn't seem to work. StyledDocument doc = textPanel.getStyledDocument(); Style style = textPanel.addStyle("Hightlight background", null); StyleConstants.setBackground(style, ...

jQuery grabing the color of an element PRE :hover

I'm trying to create a generic 'flash of color confirmation' function where it'll flash the background of an object to green and then fade out to whatever it's existing color was. So I may have two elements that I call this on click(): li background-color: red li background-color: black If I click the first one, it'd fade from green ...

how to set backroundcolor

Is there a way to set a common Backgroundcolor for all the tabs in a given TabBar? Rightnow I am able to set color only for selected tabs using tabBar.getChildAt and setStyle ...

WPF Colors - Accessibility considerations?

Many of the WPF examples and samples that I see seem to have hard-coded colors. These guidelines - http://msdn.microsoft.com/en-us/library/aa350483.aspx suggest not hard coding colors. After building a small application I was disappointed to see that some of my hard-coded color choices made some sections of the application unusable when ...

JS function to calculate complementary color?

Does anybody know, off the top of your heads, a Javascript solution for calculating the complementary colour of a hex value? There is a number of colour picking suites and palette generators on the web but I haven't seen any that calculate the colour live using JS. A detailed hint or a snippet would be very much appreciated. ...

Eclipse highlight occurrences, right column marker color

Similar, but different to this question: I use highlight occurrences a lot, but sometimes I'm irritated by how hard it is to see the little grey-ish rectangles on the rightmost side of the editor - to the right of the scrollbar. Is there any way to change the color of these markers - looking in General -> Editors -> Text Editors -> Ann...

Mouse over Color in Java

I need to make a game in Java for a project. What I'm trying to do is a game where you have to go through a maze without touching the walls. Is there a way to get the color of the pixel the mouse is over? ...

simple text color in rich text box

I can find a million examples of doing reg ex to apply syntax highlighting to a rich text box. but what i need it just a simple way to add in a word of a diffrent color. What would the code be to just put the words "Hello World" into a textbox and have Hello be red and World be green? This code doesnt work. this.richTextBox1.Selectio...

Opera colors strangeness

I jave a Javascript code that draws a shape with specific color using "style.backgroundColor=". It works fine with one exception - for some reason Opera decides to set the color to similar, but not exactly the same one as the one that I want. For instance, if I set the color to #324252 Opera decides that it should be #314152! All other b...

Assign css to specific element

I have an <li> element on the page that I want to look a certain way. Changing the css affects all the <li> elements. here is the element I want to change <li>Outside Job<span class="toggle"<input type="checkbox" /></span></li> here is my css for the <ul><li> ul li { /*font: normal 17px Helvetica;*/ color: #a9a9a9; border...

Converting an rgb image to hsv

Hi, I'm trying to convert an rgb image to the equivalent hsv one in C#. I found several algorithms to do the conversion but couldn't find how to save these values of an image after calculating it. For example after the calculation h = 287, s = 0.5, v = 0.34 . Where should I save these values in the image file to convert it to the equiv...

How do I use GDI+ to change the color of a line when it overlaps a region?

I'm using .NET GDI+ to draw a wavy line on a chart. (think sharetrading) I want it to change color if the line goes above 90% or below 10%. Any tips on how to get the color to change? My two ideas are:- 1. Create rectangles from 0%-10% & 90%-100% & somehow use them are a color clipping/transform region. is that possible if so how. 2. ...

Find images with similar color palette with Python

Suppose there are 10,000 JPEG, PNG images in a gallery, how to find all images with similar color palettes to a selected image sorted by descending similarity? ...