Hello, let's say I have some given coordinates x and y for a pixel, how could I make it red (keeping everything else on the page just white) in HTML? Is it possible in HTML?
Hello all,
I am not sure if its possible but I would like to create some sort of function where you pass in a string such as "yellow" or "green" and it returns its hex code or the range of hex codes that greens or yellows fit into.
Is this possible in PHP? If not possible, I am willing to try anything else that can do this!
Thanks all
I'm spending a lot of time programming and as I'm right now quite late with my work I need to work harder than usual.
I find the combination of white background and black font not so good. But it seems I can't find the proper one.
What do you use folks?
Thank you!
friends, I have to trouble you as I couldn't find a solution after trying for a long time.
I have 3 columns of data. x, y, and the stress value (S) at every point (x, y). I want to generate a 2D color plot displaying continuous color change with the magnitude of the stress (S). The stress values increase from -3*10^4 Pa to 4*10^4 Pa. I only have hundreds of data sets for an area, but I want to see the stress magnitude (read from the color) at every location (x, y). What Matlab command should I use?
Thank you very much!
I want to make a 2D color plot showing stress magnitude (S) at very loctaion (x, y) based on continuous color change using limited
I try to display thanks to vtk (python wrapper) several glyphs in a scene with each their own colour and rotation. Unfortunately, just the rotation (using vtkTensorGlyph) is taken in consideration by vtk. Reversely, just color is taken in consideration when I use a vtkGlyph3D.
Here is a ready to use piece of code with a vtkTensorGlyph. Each cube should have a random color but there all will be in the same color. I read and read again the doc of vtk but I found no solution.
Thanks in advance for any idea
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import vtk
import scipy.linalg as sc
import random as ra
import numpy as np
import itertools
points = vtk.vtk.vtkPoints() # where to locate each glyph in the scene
tensors = vtk.vtkDoubleArray() # rotation for each glyph
tensors.SetNumberOfComponents(9)
colors = vtk.vtkUnsignedCharArray() # should be the color for each glyph
colors.SetNumberOfComponents(3)
# let's make 10 cubes in the scene
for i in range(0, 50, 5):
points.InsertNextPoint(i, i, i) # position of a glyph
colors.InsertNextTuple3(ra.randint(0, 255), ra.randint(0, 255), ra.randint(0, 255) ) # pick random color
rot = list(itertools.chain(*np.reshape(sc.orth(np.random.rand(3, 3)).transpose(), (1, 9)).tolist())) # random rotation matrix (row major)
tensors.InsertNextTuple9(*rot)
polydata = vtk.vtkPolyData() # create the polydatas
polydata.SetPoints(points)
polydata.GetPointData().SetTensors(tensors)
polydata.GetPointData().SetScalars(colors)
cubeSource = vtk.vtkCubeSource()
cubeSource.Update()
glyphTensor = vtk.vtkTensorGlyph()
glyphTensor.SetColorModeToScalars() # is it really work ?
try:
glyphTensor.SetInput(polydata)
except AttributeError:
glyphTensor.SetInputData(polydata)
glyphTensor.SetSourceConnection(cubeSource.GetOutputPort())
glyphTensor.ColorGlyphsOn() # should not color all cubes independently ?
glyphTensor.ThreeGlyphsOff()
glyphTensor.ExtractEigenvaluesOff()
glyphTensor.Update()
# next is usual vtk code
mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(glyphTensor.GetOutputPort())
actor = vtk.vtkActor()
actor.SetMapper(mapper)
ren = vtk.vtkRenderer()
ren.SetBackground(0.2, 0.5, 0.3)
ren.AddActor(actor)
renwin = vtk.vtkRenderWindow()
renwin.AddRenderer(ren)
iren = vtk.vtkRenderWindowInteractor()
iren.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera())
iren.SetRenderWindow(renwin)
renwin.Render()
iren.Initialize()
renwin.Render()
iren.Start()
I'm trying to check if a color is already entered into the database if it is the color should not be entered and stored into the database and the following error code <p>This color has already been entered!</p> should be displayed. But for some reason I cant get this to work, can someone please help me?
The color names are entered into $_POST['color'] which is an array entered by the user.
Here is the html code that collects the colors.
<input type="text" name="color[]" />
<input type="text" name="color[]" />
<input type="text" name="color[]" />
<input type="text" name="color[]" />
<input type="text" name="color[]" />
<input type="text" name="color[]" />
<input type="text" name="color[]" />
<input type="text" name="color[]" />
<input type="text" name="color[]" />
Here is the PHP & MySQL code.
for($i=0; $i < count($_POST['color']); $i++) {
$color = "'" . $_POST['color'][$i] . "'";
}
$mysqli = mysqli_connect("localhost", "root", "", "sitename");
$dbc = mysqli_query($mysqli,"SELECT *
FROM colors
WHERE color = '$color'
AND user = '$user_id' ");
if(mysqli_num_rows($dbc) == TRUE) {
echo '<p>This color has already been entered!</p>';
} else if(mysqli_num_rows($dbc) == 0) {
// enter the color into the database
}
I want to buttons of different colors, but I want to do so while using
the default button background resource in order to preserve the
onfocus and onclick states. This is because I want to use the default
highlight color of the OS for my app, which is NOT always orange (HTC
Sense makes it green).
I found that adding a color filter to the button's background drawable
works great (in this case, blue):
myButton.getBackground().setColorFilter(Color.parseColor(this.getString
(R.color.button_blue)), Mode.MULTIPLY);
BUT, when the button is focused or clicked, it turns a nasty
orange_blue because it mixes the color filter with the orange of the
background drawable.
I want to ONLY set this color filter for the unfocused/unclicked nine-
patch drawable within the default button's statelistdrawable.
I'm not sure how else to do this.
I see a similar solution here:
http://stackoverflow.com/questions/2065430/fixed-android-detecting-fo...
but I have some concerns with that solution, mainly what if the OS
changes the graphic of the default button? Since the normal unfocused/
unpressed graphic is now hardcoded into the app, it would break the
flow.
Maybe can someone comment on whether it would be good or bad practice
to hardcode the default graphic into the app? What are the chances of
the OS completely changing the graphic?
Any help please? Thanks very much!!
Is there any way to set the default font color for new messages in Mail.app?
It's trivial to set the actual font, and text size. I cannot seem to get the application to change the text color though. It always defaults to black.
After 5 or 6 major revisions of OS X, surely someone has thought of this, right?
Is there a plugin that can let Photoshop use a HSL color picker, rather than HSV (which Adobe calls HSB)?
In other words, any/all of the following locations could have an HSL option:
Or perhaps a plugin with it's own color picker.
Reference
RGB HSL HSV (aka HSB)
============= =============== ================
(1, 0, 0 ) ( 0°, 1, 0.5 ) ( 0°, 1, 1 )
(0.5, 1, 0.5) (120°, 1, 0.75) (120°, 0.5, 1 )
(0, 0, 0.5) (240°, 1, 0.25) (240°, 1, 0.5)
I have an image which looks like this:
http://img21.imageshack.us/i/64054053.jpg/
However the yellow line needs to be red and the cyan line needs to be green. I have MS Paint and IrfanView.
How can I change the colors of the yellow and cyan line without individually selecting all pixels manually?
I.e. what is a good way of changing all pixels of one color to another color?
Hello,
I've changed the terminal colors and now irssi statusbars have white text on light blue background. I would like to change the foreground color of the irssi statusbars to black but can't figure out how to do it. I don't want to download a whole theme, I only want to change this one color.
Any idea? Thanks in advance!
-Martin
I have php code written in test.inc file but dreamweaver is showing no color highlighting.
Is there any way to make them same color code as .php extension
I'm doing a lot of website design and I'm looking for a feature that would allow me to set the main colors of website in variables and use the variables in color overlays and such.
It would make changing the color scheme of site a lot easier and that would help previewing different possibilities. So, does such feature exists, or is there some kind of plugin for it? I'm using CS3 and I have CS4 available if it's required for this.
I was having a bit of trouble reading the dark red strings of Vim's default color scheme, so I decided to switch to a different one.
http://code.google.com/p/vimcolorsch...kboard.vim?r=2
http://files.werx.dk/wombat.vim
However, when I set my color schemes to these, not only do they not come out correctly (for example, comments are bright blue), but these 2 somehow come out looking exactly the same!
Am I doing something wrong, or are these colors restricted in the terminal so default colors are being chosen?
I'm thinking of getting a budget color laserjet. Will I need to buy four toner cartridges at the same time I get the printer, or do they come with starter toner cartridges?
If there is toner with it, any idea how many pages I can get on what's in the box?
The Samsung CL-315 or the HP Color LaserJet CP1215, both under $200, are good examples of the class of printer I'm looking at.
Thanks!
I know how to change my color scheme in Vista. What I despair about is that after I change it, if I switch to another scheme (such as back to Aero), my customized scheme is gone. If I want, I can take another 30 minutes to customize it so it doesn't burn out my eyes. Is there any way to save this scheme? I tried doing the color scheme change, then trying to save the whole thing as a theme, all to no avail.
Windows 7 (non-Aero) uses a very low contrast white font color on my light blue taskbar. Personalize Window Color does not offer an option to change the taskbar font. Is there any way to change this font?
Regards,
tamberg
Trying to write a simple paint program for iPhone, and I'm using Apple's glPaint sample as a guide. The only problem is, painting doesn't work on a white background, since white + colour = white. I've tried different blending functions, but haven't been able to hit on the right combination of settings and/or brushes to make this work. I've seen similar posts about this problem but no answers. Does anyone know how this might work?
I need to place labels with a transparent background over a variable-content UIImage. Readability will vary significantly depending on the relationship between the color of the label's text and the color/luminosity of the area of the image displayed under the label. Since the image will be constantly changing, the color of the label's text needs to change in sync.
I have found several techniques for determining the color, perceived luminosity etc of a single pixel. However, I need to rather quickly (while a view loads) determine the rough perceived color/luminosity of an area of the UIImage under the frame of the UILabel. I presume I will also need to measure the alpha because the same color/luminosity looks different at different alpha values.
Is there a way to calculate such a value for an area? Will I be reduced to simply summing pixels? If it comes to that, is there an algorithm to accomplish this?
I've thought of two possible approaches:
Perform some "folding" operations i.e. combining pixels from one half of the area to the other half. Then repeat until I get a single value. Would this be practical? How would you logically combine pixels to average their perceived color/luminosity?
Sample a statistically significant number of pixels in the area and then combine them (somehow) to get a rough measure.
I think this problem comes up a lot these days with people being so found of customizing backgrounds. Seems like something that would be worth my time to bang out a category or class to handle this and then share it around.
Years ago I was the lead developer of a large Scrapbook Web Site. One of the things I implemented was to allow shoppers to find Scrapbook papers and embellishments of like colors (“more like this color”). Below is the base algorithm I wrote to extract the color from an image. It worked out pretty well. I took the returned values and stored them in an associated table for the products. Yet another algorithm was used to SELECT near matches.
This algorithm has turned out to be very handy for me. I have used it for borders and subtle outlined text overlays. I am sure you will find more creative uses for it. Enjoy…
private Color GetColor(Bitmap bmp)
{
int r = 0;
int g = 0;
int b = 0;
Color mColor = System.Drawing.Color.White;
for (int i = 1; i < bmp.Width; i++)
{
for (int x = 1; x < bmp.Height; x++)
{
mColor = bmp.GetPixel(i, x);
r += mColor.R;
g += mColor.G;
b += mColor.B;
}
}
r = (r / (bmp.Height * bmp.Width));
g = (g / (bmp.Height * bmp.Width));
b = (b / (bmp.Height * bmp.Width));
return System.Drawing.Color.FromArgb(r, g, b);
}
You could also get the RGB values by passing in the RGB by ref
private Color GetColor(ref int r, ref int g, ref int b, Bitmap bmp) but that is a bit much as you can simply get it from the return value: mReturnedColor.R; mReturnedColor.G; mReturnedColor.B;
I am about to buy a color printer. I had a B&W Laserjet printer in the past but since then I've used inkjets for decades. I need a printer that can deliver high quality as these photo inkjet printers, but I'm tired of paying for ink that costs $9,000 per gallon (1 gallon = 3.785 liters = 300 cartridges = $9,000).
So, I was thinking about buying a color laser printer, but I'm not sure these printers can deliver the same quality and are worth the investment in terms of toner consumption.
I remembered that my old Laserjet printer was able to print 1100 pages per toner cartridge. The inkjet printers I have can print 500 pages per cartridge. Price by price, 2 inkjet cartridges have more or less the same cost as one toner cartridge and in theory prints almost the same. I am not sure if this is true for color lasers.
What can you guys tell me about quality, toner cost and cost per page for laser or inkjet printer? Is it worth the change? (Keep in mind that an inkjet printer costs $50 and a laser printer costs $200.)
Thanks.
Probably a simple question but:
How do I programmatically change the color of an ellipse that is defined in XAML based on a variable?
Everything I've read on binding is based on collections and lists -can't I set it simply (and literally) based on the value of a string variable? string color = "red" color = "#FF0000"
I have a custom UITableViewCell with a custom layout. I wanted a gradient background, so in my UITableViewDelegate cellForRowAtIndexPath: method, I create a CAGradientLayer and add it to the cell's layer with insertSubLayer:atIndex: (using index 0). This works just fine except for two things:
Most importantly, I can't figure out how to change to a different gradient color when the row is highlighted. I have tried a couple things, but I'm just not familiar enough with the framework to get it working. Where would be the ideal place to put that code, inside the table delegate or the cell itself?
Also, there's a 1px white space in between each cell in the table. I have a background color on the main view, a background color on the table, and a background color on the cell. Is there some kind of padding or spacer by default in a UITableView?