Cannot change textcolor for Text in Unity - unity3d

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.

Related

Apply color to text with material color

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.

HTML5 Color Picker - color not changed

I've noticed a strange behavior with the color picker. When I pick any color from the basic colors (predefined colors), the button's color (the one of the html input element) is changed accordingly.
However, when picking any other color from the the gradient color picker, the button's color won't change. It will stay white. (Note: Don't pick a basic color first or refresh the jsbin page first if you're going to test it)
But... when I first pick a basic color and press OK and then pick a color from the gradient color picker, the button's color will change.
(Tested with Chrome 69)
Video (gif):
https://giphy.com/gifs/8vCEY7uyz8m17N0bkz
Test it:
http://output.jsbin.com/ivAhORu/1
var i = 0;
var inp=document.createElement("input");
inp.type = 'color';
inp.id = 'colo_'+i;
inp.value = '#ffffff';
inp.className = 'datafield';
document.body.appendChild(inp);
It's not actually an error, when you set a color picker to pure white or pure black the luminosity is adjusted to give you the desired color. When you pick a swatch the luminosity is changed to that swatch so it seems like it wasn't working before, but in fact it was working and if you adjusted the luminosity you'd see the color change correctly. You might want to consider a different starting color other than pure black or pure white.

Is there a way to change a UITextField's cursor color other than .tintColor?

Basically, my goal is to have UISearchBarIcon.search be one color, and the cursor color be another. Since I have a dark and a light theme in my app I'm using alwaysTemplate for the UIImage for the search icon.
Found something about using this:
(textFieldInsideSearchBar?.value(forKey: "textInputTraits") as! String)["insertionPointColor"] = UIColor.red
But that doesn't seem to be valid as I get "Cannot subscript a value of type 'String' with an index of type 'String'" in Xcode
I think there have been no responses, because no-one understands fully.
Is this what you want?
I just set the UISearchBar with a tint colour of deep red - which is the cursor colour
It defaults to a light grey border and black text and a white background.
The light-grey colour can be changed with barTintColor.
By setting barStyle to a UIBarStyle the choices are black, blackOpaque, blackTransparent and default. They can act as a light(default) and dark(black) theme...

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

UITextView : Changing text colour modifies text position

I've got a UITextView with a small text in it. It displays correctly with black text on white background. However, when I want to change the text colour to a colour other than black, the text position changes (as if there was an empty line added at the beginning of the text).
With no colour change or with textView.textColor = [UIColor blackColor]; :
When I change to another colour, here textView.textColor = [UIColor blueColor]; :
The code line I've given really is the only code element that changes, and even if the colours in the background and the text are different, this is because they are generated randomly, in a complete other part of my code. The content of the text NEVER had any influence on the display before, and when I change the text colour it ALWAYS looks like in the 2nd picture.
I am stunned by this behaviour, as textColor shouldn't be modifying anything else than the font colour, should it ? Plus the fact that when I change to blackColor, no weird behaviour.
Thank you for your help...
"the different colours in the background are generated somewhere else" means
Where do you exactly change the colors?
You are changing some thing like
a)autoresizing the views (or)
b)Aligning text in that view (or)
c)Frame size of your textView can be smaller than the font size of your textview (or)
d)your text would be longer than actual size of the frame.
I would like to ask you one question.
Why do you use UITextView instead of UILabel??
I'm asking because textview will bring the scrollview, when the text is longer than your frame size.Probably that would be your problem I hope..