VBA: Set transparency level in cell - vba

I have a pie chart and I would like to put a legend with the same colors in the cells.
The Pie chart has a transparency of 22.5%.
If I use the same RGB combination when I set the color in the cell, this color is different because it is much darker.
'___COLORS FOR LEGEND PIE____
If inc < 14 Then ws.Cells(rx + inc, 19).Interior.Color = RGB(colorR, colorG, colorB)
Is there a way to set transparency? I know it is possible in the charts.
If there is no way to set transparency, how canm I change my RGB code to adapt to a transparency of 22.5%?

The answer is you can't set the transparency of a cell in Excel.
This is because the Range.Interior.Color only supports the RGB and not RGBA. A - stands for ALPHA which is used for transparency.
One way around it (which I wouldn't recommend) would be to insert a shape (say a rectangle) over the cell and set its transparency to match the already transparent chart but if you have a lot of data this will definitely slow things down and if your data chages often or you are inserting/removing rows this will just be a real pain in the back bone.
Another idea would be to go online and find 2 sets of colors RGBA and its somehow matching RGB equivalents. I have seen such solutions before but never tried it myself so I can't give you any tips on it.

Related

How can I find the amount of pixels in part of an image?

I have an image and I want to see how many pixels are in different parts of the image. Is there a software I can use to do this?
In Gimp, the "Histogram" dialog applies to the selection, so the pixel count displayed is the pixels in the selection (weighted by their selection level):
In the image below the selection covers the black circle which has a 100px radius. The Pixels value is close to 100²*Pi (314000 instead of 314159).
The Count is the number of pixels between the two values indicated by the handles at the bottom of the histogram.
Of course the selection can have any shape and be obtained with various tools.
I assume PS has something equivalent.

SSRS Graded colour scale

Can SSRS make a graded colour scale (like Excel). I am attatching an image to explain what I mean.
Regards.
Yes, but it's not very easy. You can use an expression to dynamically set the fill color of a cell. The colors can be specified with their hex representation like "#AC9494". You will have to come up with a formula to define which colors the scale goes through.
Red is "#FF0000" and green is "#00FF00". So your formula would have to scale the amount of green and red (and maybe some blue) you want, convert that to hex, and then concatenate them into this format. If you search for terms like "smooth color gradient" you will get some helpful examples to point you in the right direction.

Lesscss: Why spin(#000,180) is returning #000?

I need to know how to get the inverse color by lesscss.
Example: I have #000, i need #FFF.
And i need the detail explanation of spin(). And necessary links where i can see a color wheel where i can understand how spin() works.
Thanks.
Why it is not working as you expect
The spin() function only deals with hue (color), not value (grey scale changes are a value change). Take a look at Figures 9 and 10 on this page from North Carolina State University's site. Those figures help show the difference. The spin() function is rotating only in the two dimensional space of the hue circle of color, not along the axis of the third dimensional space dealing with saturation; i.e. the gray scale itself, which is what differentiates white from black, both of which have no color saturation).
This is why on the LESS site we read of spin() (emphasis added):
Note that colors are passed through an RGB conversion, which doesn't
retain hue value for greys (because hue has no meaning when there is
no saturation)
And
Colors are always returned as RGB values, so applying spin to a grey
value will do nothing.
Getting what you want (Color Inversion)
See #seven-phases-max's answer.
The spin function changes the Hue property of a colour. Shades of grey (incl. white and black) are achromatic colours (i.e. they have the same "undefined" hue value).
To simply invert a colour use either difference function:
difference(white, #colour)
or the simple colour arithmetic:
(#fff - #colour)

How to set PowerPoint chart Point text labels to match marker colors?

In an X-Y scatter plot, I manually add text labels to data points via Point.DataLabel. Unfortunately I find that when points are crowded then it can be difficult to tell which series a label belongs to. Therefore I want to color my text labels to match the markers.
I am happy with the default markers and their colors, but unfortunately they contain MarkerForegroundColor = -1 and MarkerForegroundColorIndex = 0, no matter which series I look at. Furthermore, Application.ActivePresentation.ColorSchemes is empty. I note that point.MarkerStyle = xlMarkerStyleAutomatic.
I found that the colors correspond to the accent colors in the active Theme (only available in PowerPoint 2007 onwards):
presentation.SlideMaster.Theme.ThemeColorScheme.Colors(MsoThemeColorSchemeIndex.msoThemeAccent1 + series_i % 6);

Alpha Channel in gnuplot palette

Is there a way to define an alpha channel in a palette in either gnuplot or matplotlib?
I'm trying to combine two scalar fields into one plot and so far came up with nothing.
There is a way to set line colors with an alpha channel in the development version (4.7) of gnuplot. You can set the alpha channel as the high bits of an RGB color specification. For example,
plot x lc rgb '#AAAAAAAA'
draws a translucent gray line.
However, I'm not sure there is a way to do this for a palette.