Extend two colors bars across full width of browser? - width

I have two boxes filled with colors, a green one on the left, and gray one on the right. They go right up against each other in the middle of the screen, and I would like each one to extend the width of the browser, so the green one extends all the way to the left, and the gray one extends all the way to the right, no matter how wide the browser gets. How can I do this?

the width property supports percentage values, which are relative to the size of the window it exists in.
See:
http://learnlayout.com/percent.html
http://www.w3schools.com/cssref/pr_dim_width.asp

Related

Meshlab non-dispersed vertex Coloring

In meshlab, If I select a vertex and color it with red (per vertex color function), the result becomes
Red is too dispersed.
What I want is just : (image below was edited by photoshop):
How can I do it ?
On triangular meshes, when the color is defined in a per-vertex way, the colors are linearly interpolated across each triangle, so the result is precisely the expected one.
If you need just a way of looking at a few vertices, just enable the visualization of selected vertices and select them.
On the other hand, if you just need to reduce the color's spread, refine the mesh so that the underlying triangles are smaller, and the color is interpolated across a smaller area.
You can get something quite similar to your desired behavior.
The color dispersion is due to Gouraud shading. You can disable it clicking in the tab of face render options and change color button from "vertex" to "face" or "user defined"
To render vertex as "balls with color"
Click on the tab of vertex and choose the option Dot Decorator (1)
Change the size of dots with the Point Size Bar (2)
Let the color buttons in "mesh", not "user defined"

Create an image or photo that can change colour in Tkinter

I need to display an outline of a dog in a window. I then need to be able to change the colour for different part of the dog by inputting numbers into entry boxes- for example if I put a '1' in the 'head' entry box, the head changes to a yellow colour. The dog should be white by default.
I can just create 4 images (one for the head, body, legs, and tale) to change each part of the bod. I've thought about changing the rgb values of each image to change the colour, but this would also change the colour for the outline (meant to stay black). The only other thing I could think of was making a red, blue, green, yellow, blue, etc. version of each image (head, body, legs, tail), and then just displaying the red version of the image when I need to (and the same for other colours).
I need to know if there is any other way to do this (perhaps with the canvas widget?) before I code it because It will take a long time to change the colour of each image. I just have no idea where to start.
Thanks in advance for your answers
You will have to make different widgets for each part of the dog(e.g: Head, Abdomen etc.) and you will need different images for the dogs part and color, after that you can implement a button that changes the color with the 'if' function.

Scale down an image dynamically

In my SVG picture there are some text labels that are displayed dynamically in top part of the image. In some cases (i.e. smaller screen size, bigger font size), they partially disappear outside the vievBox (like if overflow: hidden; was set) - see the picture (the long word in the middle is the overflowing label).
My idea is to scale down the image so that the labels are visible. How to achieve this?
In my case, I had quite wide bottom margin, so I could afford moving the whole image down to uncover the top part.
Final solution was wrapping the whole image with <g transform="translate(0,10)">.
The first value refers to left-right movement, the other one to up-down (positive values move the image down, negative - up).

Text in Ellipses JavaFX

I created a custom venn chart for two sets an their intersection in JavaFX.
Now I want to show the number of elements in this sets like in the following picture:
The sets are ellipses and I used masks to give the intersection a different color.
Now I want to show the number with size and position related to the available space so that the numbers are always inside the according area.
The width for the text element is easy to calculate, but I don't know how to get available height for the text elements.
Maybe it could be helpful to have the pixels of the ellipses as path, but I have no idea to how I can get this.
Does anyone know how to implement that?
Edit:
I developed an algorithm to find the size of a rectangle, which fits in the required areas of the ellipses. The text are scaled to the size of the rectangle and it works, but now I have another problem.
I need to center the scaled text in the rectangle an I used a StackPane for that. But I can't position the StackPane in the chart parent. If I set the layoutX and layoutY the bounds in parent are different.
For example: stackPane with text = sp;
sp.setLayoutY(122.1662320906945);
The Result for getBoundsInParent().getMinY() is 97.16622924804688;
How can I set the StackPane position, if I use it in a chart class as chart children?

Tinting Drawn Textures with the Color property in XNA / Monogame, how to balance?

I have these four icons that look like this:
But I want to be able to just have 1 gray icon and then tint them different colors by setting the color in XNA / Monogames Draw function.
I took one of the images and pulled all the colour out and made it a bit lighter it to get
I also tried a version where the center of the gray image is fully white but neither look right in the game, here's an image with the icons on top and my tinted gray on the bottom (the tint color is sampled from the center of the original icons):
I figure there should be a way, given the original icons, to figure out how to make the gray icon and also the colors to plug into the draw function so that I get an exact copy of the original. I assume this is possible? How do you do it?
EDIT:
To elaborate on my issue here is another image all with blue icons, the top images are all the original blue icon for comparison. The bottom images are all grey icons I used to tint to make the middle icons. The grey icons are, from left to right, 0 saturation, 0 saturation and 100 brightness, and auto level + 0 saturation. It seems to me that by setting the saturation to 0 I am losing the ability to make the icon look right as it's not just "darker" blue but also "bluer" blue.
EDIT 2: I don't think it's possible, thanks for the help Goose.
Would it work if the grey icon was full white at the center (it's brightest point) and got darker from there.
Then you could just sample the color at the center of your source image (the colored ones) and tint with that.
I think the issue you are seeing now is that the grey image will darken the color you are tinting with, so you actually want to tint with the source color PLUS the amount of grey at the brightest point in the image (if that makes sense).

Resources