change color for only one Console.WriteLine - c#-4.0

I know, this is a beginner question, but I want to change the background colour only for this sentence but it colours all the text.
Console.WriteLine("healing spell:", Console. BackgroundColor = ConsoleColor.Green);
This is what I tried but doesn't work.

Try it
Console.ForegroundColor=ConsoleColor.Cyan;

Related

Random Background change with programming languege xojo

I've tried to create a button with the programming languege xojo, so every time I press it the background color should randomly change. The name of my window is just Window1. I can't figure out how to do it, I would appreciate an example please, I know how to generate random colors, but how do it do it with the background ?
If you've already tried to set the background color, please also ensure the HasBackgroundColor property of your window is set to True:
Self.HasBackgroundColor = True
Self.BackgroundColor = Color.Red // Use your random color variable instead

renderer.material.color giving strange results

I have a weird problem, that i can't figure out.
I want to change a gameobjects base color via renderer.material.color.
But for whatever reason, this only works for some colors.
This is my code:
first, I declare the colors:
var color_movement_available = Color(0.17,0.68,0.05,1);
var color_movement_available_hover = Color(0.33,1.00,0.17,1);
then i assign them, like this
case ("movement_available") :
renderer.material.color = color_movement_available;
break;
case ("movement_available_hover") :
renderer.material.color = color_movement_available_hover;
break;
However, when I test the script, the hovering color (pinkish) will not show.
I checked in the inspector and the color is the one i aimed for and is correctly switched.
When i change it to a bright (basecolor) green, red, blue or yellow, it works as supposed.
Other colors will produce white and some wont change anything.
Has anyone an idea what's causing this effect, or better yet, how to solve it?
What i tried so far:
switching the material renderer to diffuse (from transparent/diffuse):
same results
changing the materials initial basecolor to grey (from white):
also, no change
Maybe this has something to do with the way colors are applied ...
cheers
Edit: Screenshots:
Also, apparently, colors that are close to each other, like the same color only darker/lighter appear to be the ones producing white
I'm guessing you have a mesh renderer on your object.
Try GetComponent< MeshRenderer >().material.color

wxpython textctrl change caret colour

I'm using a wxpython textctrl & would like to hide the caret. After a lot of searching it would appear that the best approach would be to simply change it's colour to white. However I can not work out how to do this.
I found the following info:
SetCaretForeground(fore)
Sets the foreground color of the caret. The parameter fore is a wxColour object, a #RRGGBB string, or a color spec like "white". Returns None.
from here: http://www.yellowbrain.com/stc/caret.html#setfg
The code for my current textctrl is below. Any help would be appreciated.
self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE | wx.TE_READONLY | wx.HSCROLL)
Clinton.
You are using a wx.TextCtrl and the link you give is for a wx.StyledTextCtrl. These are completely different animals, and the wx.StyledTextCtrl has a lot more functionality than the simple wx.TextCtrl.
I don't think there's a way to set the caret color in an ordinary wx.TextCtrl.

Excel VBA: Set Specific Picture Color

Have tried recording a macro to get me on the way here, but am not having any luck.
I have a picture and want to use the preset colors to recolor it.
I want a macro that does the effect of Picture -> Color -> Recolor.
The only luck I've had is something along the following syntax:
Selection.ShapeRange.PictureFormat.ColorType = msoPictureAutomatic
The Googles suggest there are only 5 members we can use here, so there is no way to programmatically access some of the presets you see in the menu referenced above (e.g. the Red Accent color Dark 2 preset).
Transparent Background and Transparent Color don't really work because the icon in use has a white matte background as-is.
Anybody had any luck with this in the past?
Thank you very much for your help.
Set img= Plan.Shapes.AddPicture("C:\Picture.png", msoFalse, msoCTrue, POSITION X,POSITION Y, width, HEIGHT)
Imagem.PictureFormat.ColorType = msoPictureWatermark
Add image and config with types office code ... maybe if you modify can work

how to change the Inkscape default export color from yellow to white?

Hi
This might be a very stupid question. I am using export of 'Inkscape' to convert the svg file to png. As I am using the transparent backgroung the color of background is automatically yellow. I want to change this default colour to white
It was a mistake. as the background was transparent. It depends which image viewer are you using. While displaying everybody has its own color. In general, at linux i found it to be yellow and in windows white.
I am sorry for asking a stupid question.

Resources