Can I change the default color of a progress bar in LiveCode? - user-experience

Is there a way to change the default color of the progress bar to any color
other than green? For instance, I would like it to be red until it gets to
100% and then it turns green.

This question was asked on a LiveCode list serve and I'm answering here because others might find it useful.
No it's not possible to do this but it is easy to create a custom progress bar that you can set the color how you like.
Create two graphics. One for the border and one for the bar. Set the colors and graphic effects however you like. Group them and then add the following to the group script:
setProp uPercent pPercent -- 0..100
put the rect of grc "border" of me into tRect
put round(item 1 of tRect+(item 3 of tRect-item 1 of tRect)*pPercent/100) into item 3 of tRect
set the rect of grc "bar" of me to tRect
end uPercent

Related

FIGMA I con set that can quickly change Color

Trying to understand how to make component sets and use variance to make designing more simplified. I have a tile that has an icon on the right that I want to be able to change both what type of icon it is as well as its colour. Is there a way to create the two-component properties using variance? Do all the icons need to be grouped by color and do I need to adjust their naming conventions (still not to sure how that works as well)h
There is a more efficient way to do this, by taking advantage of Color Styles. With this method, you only have to create your icons once, and no need for variants. Color Style swapping will handle that.
Create your icon components, but using a boring black color. Avoid creating variants of the icons, if it's only the fill color that's changing.
Instead create a standard set of Color Styles for your icons.
Your designers then, could place an instance of a black icon from your library. Then use the Selection Panel to replace the black color with one of your defined color styles.

How to Change the Vaadin-Select Hover colour

Current Hover Color
I want to change the hover color when we move mouse over the items in the vaadin-select box, by default its coming in light blue color as seen in screenshot 1 but I want to change to some other color. How to do that ?
I have tried by adding
:host(:hover) {
background-color: #9cbdd6;
}
and importing as
#CssImport(value = "./styles/vaadin-select-items.css", themeFor = "vaadin-item")
Inspecting Vaadin Select
The below answer worked perfectly for the above problem,
However There is one problem happening the hover color is coming when the dropdown is closed also means the overlay is not opened. How to stop that ?
I need only to modify the hover color on the overlay as below which is happening correctly via the mentioned code but need to stop the above.
Hover color on the overlay items
Also applying theme like this is applied on all overlay items, how to apply these styles uniquely for some components.
You're on the right track, but you'll need a strong selector. If you're willing to use !important, this will work:
:host(:hover:not([disabled])) {
background: red !important;
}

Put borders to a text mesh

I want to make a simple text box prefab. How can I keep the text in the textbox? Very simple question :)
Couldn't be easier
(1) Add a canvas
HINT always select "Scale with screen size" (Unity accidentally setthe wrong default there; you only ever use "Scale with screen size")
(3) Add UI -> Text
Set horizontal to WRAP
Look at the large yellow arrow
Leave the vertical as overflow (just choose a small height, say 10, for the box: it is irrelevant).
Set the width of the box to whatever you want - other large yellow arrow.
(In your specific example, it looks like you have a gray box, with a Text sitting on top of that gray box. You should simply make the text box expand to fit the gray box.)
Unity's reactive layout system is fantastic. If you're just getting started with it, search on here for QA and don't hesitate to post more questions. It is hard to master, but worth it.

Remove the picture edges

I downloaded a icon, and now i want to reset the color of it, but i'm not good at photoshop, i've set the color of it to be red, but there are to many edges and corners, please tell me how to remove those edges by using photoshop step by step, thanks a lot.
here is the icon i downloaded:
and this is my ugly one:
The best way to alter a single color like this on a simple image such as this is to alter the Hue and Saturation [CTRL / CMD + U]...
This allows you greater color control and keeps the anti-aliased edges of the image intact.
Most beginners alter colors like this by simply selecting the color with the wand, or using the paint bucket on the color. Unfortunately this usually does one of 2 things:
Makes the ragged edges that you saw.
Leaves a halo of the old color as an orphan.
I did this in a few seconds with that tool:

Changing the color of an EditorGUI.ProgressBar?

I want to show a ProgressBar. I am using this code:
EditorGUI.ProgressBar(Rect(3,45,100-6,20),20/700.0, "Armor");
I want to change the color of the ProgressBar from a light blue color to a red color. How can I do this?
As it stands, it doesn't appear that you can. However, I had a similar issue where I wanted a very customized bar with different colors to denote different things. I ended up using EditorGUI.DrawPreviewTexture. If you initialize the colors you want to use as a Texture2D, then pass them into that function with the properly placed rectangles, you can create portions of a bar that can change size and location to give the appearance of a standalone progress bar, especially if you keep the positions and size updated in the Update() function.

Resources