MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal

Source code library - Expert Advisors, Indicators and Scripts

Subscribe to signal
Investor1
13.95%, 0.00 USD
How to Develop an Expert Advisor using UML Tools How to Develop an Expert Advisor using UML Tools Screenshot
EURUSD, M15
Demo
SelfGenerator Script
SelfGenerator
Author: MetaDriver
Rich Monster G3Rich Monster G3 Try product
Rich Monster G3
Author: figurelli
To post a new code, please log in or register

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

2012.05.14 16:07
IncColors

IncColors [ru]

Integer

Downloads:
160
Views:
884
Rating:
votes: 12
Files:
\MQL5\Include\
inccolors.mqh (20.48 KB)view

Description:

This class contains functions for working with colors. It has color conversion and other useful functions.

Conversion RGB в HSV

void RGBtoHSV(double aR,double aG,double aB,double & oH,double & oS,double & oV)

Functions from с http://www.easyrgb.com/index.php?X=MATH. All these function have 6 arguments: first 3 are parameters, the next 3 are conversion results, passed by reference.

Conversion RGB в XYZ

void RGBtoXYZ(double aR,double aG,double aB,double & oX,double & oY,double & oZ)
Conversion XYZ в RGB
void XYZtoRGB(double aX,double aY,double aZ,double & oR,double & oG,double & oB)
Conversion XYZ в Yxy
void XYZtoYxy(double aX,double aY,double aZ,double & oY,double & ox,double & oy)

Conversion Yxy в XYZ

void XYZtoYxy(double aX,double aY,double aZ,double & oY,double & ox,double & oy)
Conversion XYZ в HunterLab
void XYZtoHunterLab(double aX,double aY,double aZ,double & oL,double & oa,double & ob)
Conversion HunterLab в XYZ
void HunterLabToXYZ(double aL,double aa,double ab,double & oX,double & oY,double & oZ)
Conversion XYZ в CIELab
void XYZtoCIELab(double aX,double aY,double aZ,double & oCIEL,double & oCIEa,double & oCIEb)
Conversion CIELab в ToXYZ
void CIELabToXYZ(double aCIEL,double aCIEa,double aCIEb,double & oX,double & oY,double & oZ)
Conversion CIELab в CIELCH
void CIELabToCIELCH(double aCIEL,double aCIEa,double aCIEb,double & oCIEL,double & oCIEC,double & oCIEH)

Conversion CIELCH в CIELab

void CIELCHtoCIELab(double aCIEL,double aCIEC,double aCIEH,double & oCIEL,double & oCIEa,double & oCIEb)

Conversion XYZ в CIELuv

void XYZtoCIELuv(double aX,double aY,double aZ,double & oCIEL,double & oCIEu,double & oCIEv)
Conversion CIELuv в XYZ
void CIELuvToXYZ(double aCIEL,double aCIEu,double aCIEv,double & oX,double & oY,double & oZ)
Conversion RGB в HSL
void RGBtoHSL(double aR,double aG,double aB,double & oH,double & oS,double & oL)
Conversion HSL в RGB
void HSLtoRGB(double aH,double aS,double aL,double & oR,double & oG,double & oB)

Conversion RGB в HSV

void RGBtoHSV(double aR,double aG,double aB,double & oH,double & oS,double & oV) 
Conversion HSV в RGB
void HSVtoRGB(double aH,double aS,double aV,double & oR,double & oG,double & oB)
Conversion RGB в CMY
void RGBtoCMY(double aR,double aG,double aB,double & oC,double & oM,double & oY)
Conversion CMY в RGB
void CMYtoRGB(double aC,double aM,double aY,double & oR,double & oG,double & oB)
Conversion CMY в CMYK
void CMYtoCMYK(double aC,double aM,double aY,double & oC,double & oM,double & oY,double & oK)
Conversion CMYK в CMY
void CMYKtoCMY(double aC,double aM,double aY,double aK,double & oC,double & oM,double & oY)

Другие функции

Get RGB components

First parameter - color, the next arguments are color components, passed by reference.

void ColorToRGB(color aColor,double & aR,double & aG,double & aB)
Get R component
double GetR(color aColor)
Get G component
double GetG(color aColor)
Get B component
double GetB(color aColor)

Conversion RGB в color

color RGBToColor(double aR,double aG,double aB)
Get mixed color between 2 colors
color MixColors(color aCol1,color aCol2,double aK) // aK - from 0 to 1
Get array with color gradient
void Gradient( color & aColors[], // list of colors
color & aOut[],                  // output array
int aOutCount,                     // Size of output array
bool aCycle=false                  // cyclic gradient (the out array ends with starting color)
)
Another simple conversion RGB -> XYZ and its inverse XYZ->RGB
void RGBtoXYZsimple(double aR,double aG,double aB,double & oX,double & oY,double & oZ)
void XYZtoRGBsimple(double aX,double aY,double aZ,double & oR,double & oG,double & oB)
Negative color
color Negative(color aColor)

Finds color, closest to the color from the standard web colors

First parameter - the color, the second parameter is the index from the colors set (passed by reference), the function returns color
color StandardColor(color aColor,int & aIndex)
RGB -> Gray
double RGBtoGray(double aR,double aG,double aB)
RGB -> Gray (simple)
double RGBtoGraySimple(double aR,double aG,double aB)

Translated from Russian by MetaQuotes Software Corp.
Original code: http://www.mql5.com/ru/code/888