colors

Generating a readable colour from RGB?

Hi, I'm putting in a function which will allow a user to input a color (eg: purple) and it will change the look of their profile to be purple. It's interpreted from text into a 'Color' class which stores them inside itself as RGB numbers (int for red, one for green and other for blue). What i don't know how to do is logically turn these ...

WAP Colored Images

I'm beginning with WML development, but I hate that the only option that we have for images are the WBMP format, that is only grayscale, then I want to know if there is any way to have colored images using WAP 1.x(not the new 2.x versions of it). ...

Best way to change the background color for an NSView

I'm looking for the best way to change the background color of an NSView. I'd also like to be able to set the appropriate alpha mask for the NSView. Something like: myView.backgroundColor = [NSColor colorWithCalibratedRed:0.227f green:0.251f blue:0.337 alpha:0.8]; I notice that NSWindow has this method, and I'm not a big fan of the ...

JAVA - How do I set the colour of a label (coloured text)?

How do I set the color of the text of a label? myLabel.setText("Text Color: Red"); myLabel.??? Can I have two seperate colors in one label? For example here: The "Text Color:" to be black and the "Red" to be red. ...

Is it possible to add colorbar properties to a maltlab plot?

Hello, I'd really like to know if there's a way to add the colorbar properties we usually find in surface or mesh, but this time for a simple plot. Thanx you! ...

CSS Problem in scrollbar coloring.

.body_c { scrollbar-face-color:#408bc4; scrollbar-shadow-color:#afefff; scrollbar-highlight-color:#afefff; scrollbar-3dlight-color:#000000; scrollbar-darkshadow-color:#006399; scrollbar-track-color:#bfd3e6; scrollbar-arrow-color:#FFFFFF; margin-top:0; margin-left:0; margin-right:0; } I am using this class for coloring scrollb...

Hex Pair to Hex Shorthand

I have a bunch of Color objects (.Net). I want to convert them to Hex, which is simple enough with something like: Dim clr As Color = Color.FromArgb(255, 0, 0) Dim clrString = ColorTranslator.ToHtml(clr) Is there a way in .Net or through RegEx (or some other way) that I can determine if Hex shorthand (like #F00) is available for the s...

On Mac, two jpg's whose color should match do not

So I'm designing a myspace page and I have two images, one is a repeating bg image, and another is an image which loads on a layer above it, which acts as a header/masthead. For some reason, on Macs only, and only in the browser (tested in safari and ff), the masthead renders slightly darker than the repeating bg image, creating this co...

How to draw circle with specific color in XNA?

XNA doesn't have any methods which support circle drawing. Normally when I had to draw circle, always with the same color, I just made image with that circle and then I could display it as a sprite. But now the color of the circle is specified during runtime, any ideas how to deal with that? ...

Change the Color Of Certain Words In Textarea using Jquery ?

How to Change the Color Of Certain Words In Textarea using Jquery ? For instance, i have a textarea <textarea id="txt"> </textarea> When i type into the textarea, certain words like "is, a , was ..." should be colored or highlighted. The aim is to create a ultra simple HTML syntax highlighter for my project that's all ! ...

Get pixel color with Rails or anything else

I'd like to build a webapp in Rails in which I'd like to determine every pixel's color of a given image (JPEG). Is there any possibility to do that with Rails or JavaScript? The goal is to write an algorithm which determines the "middle color" of the image and uses it for background color of the site. Any suggestion would be appreciated...

How do I bind to a color in a WPF ColorAnimation?

I would like to do something that is seemingly quite simple, but I cannot figure out how to do it. I have a ColorAnimation that is triggered when the MouseEnter event occurs. It simply changes the background color of a Border from one color to another color. Unfortunately, I can't figure out how to put anything but hardcoded colors in...

Function that converts hex color values to an approximate color name?

I don't suppose anyone knows of a function (PHP, preferably) that can take a hex color code and give an approximate color name for that hex value. I don't need a solution with 100s of colors. Even if it just amounted to the colors white, black, red, green blue, brown orange and yellow, I'd be pretty well in shape. If you don't know of a...

jQuery - color cycle animation with hsv colorspace?

Hi there, I am working on a project, which I need a special body-background for. The background-color should cycle through the color spectrum like a mood light. So I found this: http://buildinternet.com/2009/09/its-a-rainbow-color-changing-text-and-backgrounds/ "But" this snippet is working with the RGB colorspace which has some very l...

How to Create a Duotone Interpolation Color in GDI+ (.NET)?

I have two colors that I need to linearly interpolate to create a duotone color based of another color's luminance value. Dim clr1 = Color.Black Dim clr2 = Color.FromArgb(224, 255, 165) Dim lum = Color.FromArgb(226, 189, 136).GetBrightness 'lum = 0.71 I know the result of this should be R=171, G=192, B=125, but I can't figure out how ...

how to get font color changing script just like mail box??

I need to add a font color changing tool section in my form's text area same as we have in our mail boxes.I tried to find on net but didnt get anything useful.Please tell me how can i implement that font color changing tool on my page using javascript???? ...

Custom ListBox Highlight Colours

Hi there. I'm trying to override the default ListBox colour properties when an item is highlighted. However, this XAML code simply causes the text of the highlighted item to disappear completely (or become transparent). <SolidColorBrush Color="{Binding Path=Foreground, ElementName=UserControl}" x:Key="{x:Static SystemColors.ControlText...

Visual studio line colors

In Visual Studio, what does the vertical color bar between the line numbers and the code mean? Sometimes there is green, yellow, or nothing. ...

Sorting a list of colors in one dimension?

I would like to sort a one-dimensional list of colors so that colors that a typical human would perceive as "like" each other are near each other. Obviously this is a difficult or perhaps impossible problem to get "perfectly", since colors are typically described with three dimensions, but that doesn't mean that there aren't some sortin...

Hex Code Brightness PHP?

I want users on my website to be able to pick a hex colour, and I just want to display white text for dark colours and black text for light colours. Can you work out the brightness from a hex code (preferably PHP)? ...