Apply opacity to theme color keeeping the tie to the original color - google-slides

In Google Slide, I would like to use a theme color and apply opacity to it.
I know I can do this by adding a new color and setting the transparency, the problem is that when I change the theme color, the new transparent color will not change.
Up until today, I thought this was just a missing feature in Google Slides, but a template I bought from a marketplace, has this exact feature, i.e. there is a shape which has a theme color and is also transparent, the problem is that I cannot change the transparency without incurring in the above mentioned problem.
My question is, is there a way to change the transparency and also keep the color tied to the theme color?
As an example, what I want to achieve is: create shape_1 and give it theme_color_1 (let's say it is #0029FFFF). Set transparency of shape_1 to 50% (so the color is #0029FF80). Change theme_color_1 (say to #44FF32FF). I want shape_1 to have new color #44FF3280.

Related

Get the color after opacity but dont make the component transparent

I am working on a project and I want it to get the transparent color but getting the color from the backend and make it rbga code and then setting the alpha parameter to 0.3. But making this the div I am making is being transparent. Is there a way to get that color without making the div transparent. For exemple from the backend I get the color: #A79B8E But I want the background to be: #DCD7D2. Which is #A79B8E but with the opacity of 0.4. When I do it the component using the new color seems to be a little bit transparent.
In this picture you can see that Color2 divs are somehow transparent:

Javafx change color on sliding the slider

I'm trying to create an application where the theme or background color of the application changes on changing the slider position. The color changes within specific range of hex color codes.
For example: In Dark mode of an application, if I move the slider then background color changes to different shades of dark mode either brighter shades or darker shades of dark mode
use the valueProperty() method of the slider call .addListener(observable->{}) and in the {} set the background color according to the getValue() value of the slider. How you convert value to background color is left for u to figure out.

Modify default widget text color with applied stylesheet of QTreeWidget items

I have a QTreeWidget (however this question relates to any kind of widget) in which I have items which, under certain circumstances change their foreground color to red using item.setForeground(0,QBrush(QColor("red"))).
Later they can change their foreground color back to black. But the problem is that if the widget has been set some stylesheet which has changed the foreground color to other than black, I am in trouble. My question is how to revert the color of an item to the default color used by the widget for text color given the applied stylesheets?
For example if I apply a dark stylesheet which makes widget background dark and default text color white, first I can see white items, then they change to red and then they become black. But I want them white again. But I do not know how to find that it is white (and not black) color they should change to.
I tried this:
1) if I use item.setForeground(QtGui.QBrush()) which I hoped would use empty and therefore default brush, I always get black text
2) if I query the text color treeWidget.palette().text().color() I always get the same color regardless of the stylesheet
This question doesn't really apply to "any kind of widget", because there is no guarantee that setting the foreground colour will always work. To quote from the docs for QPalette:
Warning: Some styles do not use the palette for all drawing, for
instance, if they make use of native theme engines. This is the case
for both the Windows XP, Windows Vista, and the Mac OS X styles.
However, if the question is restricted to model items (such as QTreeWidgetItem), you can clear the current settings like this:
item.setData(column, QtCore.Qt.ForegroundRole, None)
On platforms that do allow changes via the palette, you could get the default palette like this:
palette = QtGui.qApp.style().standardPalette()
which should then allow you to restore the original values.

Disabled QGroupBox title shadow (aka etching)

Look thoroughly at the disabled QGroupBox title (see attached image).
You'll notice a tiny white 1-pixel shadow under the title's letters.
It's barely noticeable on default style sheet, but it can be much more annoying if you set dark background and text color.
What can I do to disable this shadow, or at least change its color?
What style are you using? It looks like the 'basic' Windows style. If you want to get rid of the text shadow, you can implement your own style and change the way the text is drawn for disabled group boxes. Read more about about QStyle and how to create a custom style here. The link is for Qt 5.1, but the principle is the same for Qt 4 as well.
An easier way would be to simply change the palette for the QGroupBox object. Change the color identified by color group QPalette::Disabled and color role QPalette::Light to any color with the alpha channel set to 0, e.g. QColor(0, 0, 0, 0). This will effectively disable the text shadow. However, it will also disable the shadow of the lines so it might not be what you want.
I've found a solution:
Unfortunately, you can't remove disabled text shadow (aka etching), but you can change its color using dirty workaround:
It looks like shadow effect always takes its color from the ColorGroup "Disabled" and the ColorRole "Light" of the current palette. So, you just set this color to the background color of your widget:
QPalette p = myWidget->palette();
p.setColor(QPalette::Disabled, QPalette::Light, QColor(0,0,0)); <- place your widget bg color here
myWidget->setPalette(p);
I've found this solution here

Changing background color and text

In the webform1 by using a color picker i have choosing a color.In the webform2 the color should be appeared as background color and if there is any letters or text in the webform2 it have to change as an opposite color.
for example:
background is black text is white.
background is blue text is red.
in a gmail settings themes are there if we change a theme background is different
color and text is another color.but in that themes colors are already fixed for background and text.but we using color picker
please advise me.
Thanks
This stack overflow question might have some answers for you.
Given a background color, how to get a foreground color that makes it readable on that background color?
Possible other solutions include:
Add picker for foreground color.
Create preset foreground colors for each available background color.

Resources