Apply color to text with material color - unity3d

Using TextMeshPro, I would need to apply color to a specific section of the text but at the same time the default text has material color applied.
string text = "Here is default text with brown text\u003Ccolor=#4186FC>Blue text here\u003C/color>"
The problem is that the final result is the multiplication of both color and then the blue part resolves as almost black. If material color is white then no problem.
Would there be a way to cancel the material on this part without making two different text objects?

You are going to want to use Rich Text. For your example you'd want to use the <color> tag. Here's how it would look
string text = "Here is default text with brown <color=#4186F>Blue text here</color>"
There's a bunch of other parts of the text you can change in the same text field using these tags, so be sure to read into the link.

Related

How to add red star with name of column header in Nattable?

i am trying to update the columname after doing some filter with red star.But is am not able to do it.Please help me to resolve this issue.
Styling in the column header is the same as anywhere else. You typically set a label on the column header cell that should be styled differently, and then register a custom painter for that label. And if you want to show a red star with black colored text, I suppose you need to decorate a TextPainter with an ImagePainter for the red star, or use a RichTextPainter, as the default TextPainter does not support different font styles.

Is it possible to change Color on a per line basis in NSTextField?

I have a Swift Mac OS X project with a NSTextField where I display multiple lines of text. I can change the color of all the text in the text field
searchResult_field.stringValue = result
searchResult_field.textColor = NSColor.redColor()
But I'd like to be able have some lines the default color and others a different color.
You can use NSAttributedString to color each range of the string in a different color.

Cannot change textcolor for Text in Unity

I need change Text color for UI Text to red, I tried on Indicator and script but the text color still have black color. What is wrong here ?
continueText.color = Red.color;
or
coreText.text = "<color="+textColor+">textContent"</color>";
or
Normally, Font include texture and metarial is packed. Here I make a editable copy of original font so that the metarial is unpacked. We need add metarial to Metarial box under color box choice to change color.
Thanks to #mgear for your help.

Change the Text Field for Required Field in Oracle Forms 6i

I want to display the required text field in star symbol
if user didnt enter any values it should change the Border color to red
if user enter values it should Change the Border color to green
Unfortunately you can't simply change border color of an item. You can change background nad text color.
You can simulate border color by adding new item which is 2 pixels longer and higher than your item. Place this item under your item and change its background color. It is not as difficult as it looks.
You can change color in WHEN-VALIDATE-ITEM on your item using builtin procedure SET_ITEM_INSTANCE_PROPERTY

GWT textBox with different coloured alpha numerics

I want to allow the entry of different coloured alpha numeric into a text box. The person clicks on one of four buttons (blue, grey, green or red) to select the colour and that colour applies to all alpha numeric entered into the text box until a new colour is selected (e.g., KPB - the K is blue and the PB is red; -6 is green).
Thanks,
Glyn
Hi #AndreiVolgin,
This is how I implemented your suggestion. I am working on getting the display a bit "nicer".
Thanks,
Glyn
You cannot style text inside a TextBox - even "::first-letter" selector does not work on it.
You can try to create your own widget which will include a transparent TextBox widget on top of a Label widget, where on each KeyUpEvent in the TextBox you update the Label widget with the corresponding text in different colors.