implicit conversion from string to color

 

The code line below gives warning (I would like to get ride of) how?

color mColor; 
mColor = "0,88,117"; //<<<< generates a warning.
 
samjesse:

The code line below gives warning (I would like to get ride of) how?

Try single quotes not like yours 'xxx,xxx,xxx', I think yours indicate string not colour 
 
Stanislav Ivanov:
Try single quotes not like yours 'xxx,xxx,xxx', I think yours indicate string not colour 
 
samjesse:

The code line below gives warning (I would like to get ride of) how?

https://www.mql5.com/en/docs/basis/types/integer/color


So, it should be:

color mColor; 
mColor = C'0,88,117';
Documentation on MQL5: Language Basics / Data Types / Integer Types / Color Type
Documentation on MQL5: Language Basics / Data Types / Integer Types / Color Type
  • www.mql5.com
type is intended for storing information about color and occupies 4 bytes in memory. The first byte is ignored, the remaining 3 bytes contain the RGB-components. Literal representation consists of three parts representing numerical rate values of the three main color components: red, green, blue. The constant starts with C and is enclosed in...
 
Imran Bat:

Do not just quote other people's posts. It is extremely annoying.

If you have something useful to add to a topic, then please post, but if you have nothing useful to add, don't post at all.