Flutter - how to change selected text color? - dart

i have this TextFormField so far, i've changed the highlighted background color with textSelectionColor property and the handlebars color with textSelectionHandleColor. But how can i change the text color of the highlighted text as shown in the image above?

Didn't find any property that directly does this but i found an alternative way withOpacity() function, which does the job as intended. Example:
Color(0xff00BCD4).withOpacity(0.3)

Related

How to toggle cell color when clicking on that cell

I'm trying to find function that will change (toggle) cell color when you would click on it.
For example, I have cell that that only has number "1" on it and it's default color is white, so when I click that cell (like you would on click on a checkbox) the color should now be blue. If you would click it again, the color should go back to white etc.
What I tried so far:
Using Dta validation to change checkbox value to text so that both TRUE and FALSE statements simply are written as number 1, but I got validation error that both states couldn't be named the same
Using Conditional formatting. so when checkbox is checked, color of that cell is changed (this works to some degree, but for some reason not when I use it together with Data validation)
Does anyone have solution on how should I approach this?
In theory it could be possible with the onSelectionChange trigger on an apps script function. It could be a simple function that:
Gets the selected or active cell range
If the background color is white, changes it to blue
If the color is already blue, changes it back to white
Changing color is already doable with the setBackground function.

When text is selected everything becomes white ios swift

I have been working with JLStickerTextView. it has a JLAttributedTextView which basically extends UITextView.
My problem is When I select a text inside the JLAttributedTextView, everything becomes white.
Normally it looks like this
https://user-images.githubusercontent.com/17532073/38668425-bc8af2ce-3e65-11e8-8998-89ece0e48ae1.png
But after selecting the texts, it becomes like this
https://user-images.githubusercontent.com/17532073/38668470-d4101e56-3e65-11e8-9dd7-6da03037b32f.png
I needed to clear the tint color from the textview. And it solved the issue. Thanks.

Is it possible to change the color of a MaterialDesignIcon?

I use a MaterialDesignIcon in a label like this:
Label info = new Label("Label", MaterialDesignIcon.AC_UNIT.graphic("-fx-fill: red;"));
I don't know what CSS is supports (https://docs.oracle.com/javase/8/javafx/api/javafx/scene/doc-files/cssref.html) but I thought it was Text. -fx-underline worked and so did -fx-font-size. I understand that other font properties don't always work because the font doesn't support them, so that's fine. None of the Shape properties worked so the above fill doesn't do anything.
I only see the colors change by the Swatch but I want something local. What CSS properties are supported and how can I change a single icon's color?
MaterialDesignIcon.graphic() creates an instance of Label. So to change its color you can use fx-text-fill: red.
To inspect your GUI you can use ScenicView

Text selected without showing the pins

Is there a way to programmatically select a text without showing the pins at the beginning and at the end of the selected text?
Example:
Although you should be more precise, I presume you just want to highlight some parts of the text with a background color. Therefore you can use NSAttributedString.
You can look up how to create an attributed String here and how to use background color on it here.

How to get the Forms background color with VCL.Styles

Some components paint their color with the Color property setting even when vcl,styles are used. So when using a Metro dark style (nearly black) and a components color is set to clWindow the components color does not match the style. Is there a way to get the forms background color when using a vcl.style so that the color property of a component can be set to match the forms styled background color?
The color can be obtained by loading the style in the style designer, but I'd like to get the color value at runtime.
You can use the GetSystemColor function passing the proper system color constant to get
for example to get the background color of a TEdit component use
TStyleManager.ActiveStyle.GetSystemColor(clWindow)
And to get the default background color of a form try
TStyleManager.ActiveStyle.GetSystemColor(clBtnFace)
Also you can use :
StyleServices.GetStyleColor(scWindow)

Resources