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

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)

Related

How to match subplot ranges in mplfinance

When drawing the RSI, I am thinking of drawing the 25% and 75% horizontal lines.
With automatic range adjustment, the 25% line is displayed as a separate axis on the right side from 20 to 30.
I can use ylim=() to adjust the range and it works fine, but it still doesn't combine the 75% on the left side with the RSI axis, and the scale is displayed on the right side, which is not smart.
Is there a better way to do this?
Translated with www.DeepL.com/Translator (free version)
Are you using hlines or mpf.make_addplot() to draw your 25% and 75% lines?
It sounds like you are using mpf.make_addplot() (otherwise the hlines would be drawn on the same axis as the prices).
If so, when calling mpf.make_addplot() use kwarg secondary_y.
As explained between cells In [15] and In [16] in the addplot tutorial ...
mpf.make_addplot() has a keyword argument called secondary_y which can have three possible values: True, False, and 'auto'.
The default value is 'auto' which means if you don't specify secondary_y, or if you specify secondary_y='auto', then mpf.plot() will attempt to decide whether a secondary y-axis is needed, by comparing the order of magnitude of the addplot data with the order of magnitude of the data that is already on the plot.
If mpf.plot() gets it wrong, you can always override by setting secondary_y=True or secondary_y=False.

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.

VBA: Set transparency level in cell

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.

Input parameters of CITemperatureAndTint (CIFilter)

I fail to understand the input parameters of the CIFilter named CITemperatureAndTint. The documentation says it has two input parameters which are both a 2D CIVector.
I played with this filter a lot - via actual code, via Core Image Fun House (example project from Apple - "FunHouse") and via iPhoto.
My intuition says that this filter should have two scalar input parameters: One for the temperature and one for the tint. If you look at the UI of iPhoto you see this:
Screenshot of iPhotos Temperature and Tint UI:
As expected: One slider for the temperature and one for the hue. How did apple "bind" the value of each slider to a 2D-Vector? akaru asked this question already but got no answer: What's up with CITemperatureAndTint having vector inputs?
I have opened a technical support incident at Apple and asked them the same question. Here is the answer from the Apple engineer:
CITemperatureAndTint has three input parameters: Image, Neutral and
TargetNeutral. Neutral and TargetNeutral are of 2D CIVector type, and
in both of them, note that the first dimension refers to Temperature
and the second dimension refers to Tint. What the CITemperatureAndTint
filter basically does is computing a matrix that adapts RGB values
from the source white point defined by Neutral (srcTemperature,
srcTint) to the target white point defined by TargetNeutral
(dstTemperature, dstTint), and then applying this matrix on the input
image (using the CIColorMatrix filter). If Neutral and TargetNeutral
are of the same values, then the image will not change after applying
this filter. I don't know the implementation details about iPhoto, but
I think the two slide bars give the Temperature and Tint changes (i.e.
differences between source and target Temperature and Tint values
already) that you want to add to the source image.
Now I have to get my head around this answer but it seems to be a very good response from Apple.
They should be 2D vectors containing the color temperature. The default of (6500, 0) will leave the color unchanged, as described here. You can see what values for color temperature give you which colors in this wikipedia link. I'm not sure what the 2nd element of the vector is for.