implicit conversion from string to color

To add comments, please log in or register
samjesse
643
samjesse  

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

color mColor; 
mColor = "0,88,117"; //<<<< generates a warning.
Stanislav Ivanov
1935
Stanislav Ivanov  
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 
Imran Bat
9
Imran Bat  
Stanislav Ivanov:
Try single quotes not like yours 'xxx,xxx,xxx', I think yours indicate string not colour 
Andrey Barinov
41909
Andrey Barinov  
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...
Keith Watford
Moderator
13921
Keith Watford  
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.

To add comments, please log in or register