Creating a transparent color within a string palette - transparency

I am working within Google Earth Engine and am trying to create a no-color/completely transparent color (no boarder and no fill). Below is a line of code where the first color should be the transparent "color". Basically I want my min value to not show up in the map at all.
Map.addLayer(image, {min: 0, max: 3, palette: [transparent, '#0571b0', '#FFDF00', '#ca0020']},'image');
I have tried creating a variable to set a color as completely transparent (change the opacity to 0), but the palette command cannot take variables. Only strings. I've also read SVG fill color transparency, but do not understand how to change the opacity of that specific color without creating a variable (which again, palette doesn't allow). Lastly, I tried adding 00 to the end of another color, but that did not work either.
Any suggestions?
Update:
I was never able to find a solution to this and ended up just going with a white back ground. It was purely for a nicer aesthetic look to allow a basemap to be seen. If I ever come across a solution, I'll be sure to post it.

I had the same question. I found the solution in the developer group.
See the answers: https://groups.google.com/g/google-earth-engine-developers/c/WcxtEIzudxw/m/GscOlsQhDgAJ
The Solution:
// create your previous mask
image = image.eq(1)
// mask and set the opacity
image = image.mask(image.mask().where(image.eq(0),0.0))

Related

Highchart fill area only between two series

Here is chart http://jsfiddle.net/erzLp3n9/2/
I need to remove color as this image is seems
this image
I have two different series.
I do not want to use area-stacked and arearange because that two different series is dynamic.
I had try by this http://jsfiddle.net/erzLp3n9/3/ but not working
By using negativeFillColor you can color the area if it is negative, which seems to be the problem with your second example.
See this fiddle.
Where I set plotOptions.area.negativeFillColor.
If you are wondering why they don't look like the same color, it is because the top one is 75% opacity, see Highcharts API.
Could you explain exactly why you do not want to use stacking? This option along with setting color of the second series to transparent gives desired effect.
API Reference:
http://api.highcharts.com/highcharts/plotOptions.series.stacking
Example:
http://jsfiddle.net/xhx34mvg/

Zeroing channels of cut out area

I imagine there is probably going to be an easy solution for this in GIMP, but I for the life of me can't figure it out.
I'm using the color picker tool with the use info window selected to verify pixel values.
Basically, I have some pixels in an image that I need to zero out. By that I mean I want the RGBA values to all be set to 0.
I attempted to:
use the rectangular select tool to select the group of pixels
use bucket fill to set the pixels to black with opacity set to 0.0
Then, to verify it was done correctly, I use the color picker to test the value of the rectangle I just filled.
Unfortunately, it seems to just contain the previous value. What am I missing here?
The "opacity" of the bucket-fill is the opacity of the paint, not the opacity of the resulting pixels. In other words the less opaque it is, the less visible the result. What you want to do is bucket-fill selection with black, then [delete].

UIView background color set is not what appears

I created a UIView with a set background color. Lets say RGB value 185, 45, 42. For some reason, when I take a screenshot of this view, it is not that color. It is a little bit darker. Is there a reason why UIView would do this?
The UIView background color is set in interface builder like this:
When I run it on the simulator and take a screenshot and use the eye drop tool to determine the color, the numbers that show up are a little bit darker than what I entered. Same with a button.
I have other screens with the same red color and the screenshot I take of those, the red actually comes out correctly. I've been trying to determine what the difference is between those screens, but so far have not seen any. So I was just wondering if anyone would have any knowledge of anything that "could" case such a color change.
A common mistake when setting a color numerically in Interface Builder is to neglect the color space:
Different color spaces will give different colors (visually) for the same RGB values.
When you set RGB color, you should notice that all the three color values range from 0 to 1, so give them a value greater than 1 would never work. Try this:
RGB(185 / 255.0, 45 / 255.0, 42 / 255.0)

Rounded textBox

Is ShapeRenderer class has the ability to do this,I would like to create boundaries for a custom object (such as a rectangle with rounded corners) and then fill it.And after that some text on that filled rounded box.
shapeRenderer.begin(ShapeType.Filled);
shapeRenderer.setColor(Color.RED);
//shapeRenderer.line(...);
shapeRenderer.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments);
shapeRenderer.line(...);
shapeRenderer.curve(...);
shapeRenderer.line(...);
shapeRenderer.curve(...);
shapeRenderer.line(...);
shapeRenderer.curve(...);
shapeRenderer.setColor(Color.BLACK);
shapeRenderer.fill();
shapeRenderer.end();
Any suggestion to do it in libgdx.
As Lestat said, you can use Scene2d.
Whether you are using Scene2d or not, a NinePatch would probably be suitable if you want to draw a rounded rectangle that scales well (check this link).
If you want to be able to set the color of your image/control, you can use NinePatch.setColor().
Here are two example scenarios regarding colors:
You will always have a black stroke/outline, and an arbitrary fill. In this case make the original image have black stroke/outline and white interior. When you 'tint' the image using NinePatch.setColor(), the stroke/outline will be unaffected and will remain black, while the interior (fill) will be the same as the color provide to the mentioned method.
You have arbitrary fill and arbitrary stroke. In this case you need 2 separate original images. First one would contain the 'fill' and would be completely white. Second one would contain the 'stroke' in white color and would be transparent inside. When drawing you would draw first the fill with its tint and then the stroke with its tint and that's all.
If for some reason you needed different corner curve radii, you would probably need separate images (or image pairs) for each radius to get the best result.

Remove black border from TcolorButton

Is there anyway to remove the black border from a TColorbutton ? Delphi xe5, developing for iOSdelp
There are actually three black or gray borders.
First, add a custom stylebook to your app. The docwiki tells how to do this:
http://docwiki.embarcadero.com/RADStudio/XE5/en/Customizing_the_Design_of_a_FireMonkey_Application
Follow step #2 (Step 3 doesn't work for mobile applications.)
Open the style editor and locate ColorButtonStyle.
Expand the tree node and click on "background" in the structure.
In the object inspector locate Fill and expand that node.
Change the fill Kind to bkNone.
That removes the wide gray bordered, leaving two dark gray 1px borders.
Further down the list of properties just below Sides is Stroke.
Change it's Kind to bkNone. That removes the outer gray line.
Depending on your app you may need to also edit the color animations below the background rectangle. I did this by erasing (blanking out) the triggers since I was unable to delete the animations.
Next go the Fill component and set the stroke kind to bkNone. That removes the inner gray line.
You may also also want to set the Fill Margins to 0 so the color extends to the outside of the object. (i.e no padding now that the gray is not there.)
Gary

Resources