MKI_COLORVALUE (API Types) Changed in Version 2014.0 |
www.CAD6.com |
C++ Syntaxtypedef DWORD MKI_COLORVALUE;
Color values used to describe a color in one of the available color models.
Element DescriptionThe data format stored in these 32 bits depends on the chosen color model (see MKI_COLORMODEL):
Color Model "RGB"BValue
GValue
RValue
To assemble such an RGB value, you can use the mki_color_make_rgb() macro.
Color Model "CMYK"CValue
MValue
YValue
KValue
To assemble such a CMYK value, you can use the mki_color_make_cmyk() macro.
Color Model "GRAY"KValue
To assemble such a GRAY value, you can use the mki_color_make_gray() macro.
Color Model "HSB"HValue
SValue
BValue
To assemble such an HSB value, you can use the mki_color_make_hsb() macro.
Color Model "CIElab" Changed in Version 2014.0LValue
AValue
BValue
To assemble such a LAB value, you can use the mki_color_make_lab() macro. This macro will automatically convert the double values to WORD-encoded values.
MKD SyntaxThe syntax depends on the chosen color model which is defined by the first value (see MKI_COLORMODE_). The number and format of the following values depends on the color model:
No Color ModelRValue/GValue/BValue
In some cases, colors are used without an explicit color model information, e.g. when stating display-dependent colors in the Section =PROFILE= of drawing files. In this case, the RGB100 color model is to be used. The three components of the RGB color model are separated by the character / (Ansi 47). Each component may have floating point values between 0.0 and 1.0 (including).
Color Model "RGB100"0/RValue/GValue/BValue
The three components of the RGB color model are separated by the character / (Ansi 47). Each component may have floating point values between 0.0 and 1.0 (including).
Color Model "RGB255"1/RValue/GValue/BValue
The three components of the RGB color model are separated by the character / (Ansi 47). Each component may have integer values between 0 and 255 (including).
Color Model "CMYK100"2/CValue/MValue/YValue/KValue
The four components of the CMYK color model are separated by the character / (Ansi 47). Each component may have floating point values between 0.0 and 1.0 (including).
Color Model "CMYK255"3/CValue/MValue/YValue/KValue
The four components of the CMYK color model are separated by the character / (Ansi 47). Each component may have integer values between 0 and 255 (including).
Color Model "GRAY100"4/KValue
The one components of the GRAY color model is separated by the character / (Ansi 47). The component may have floating point values between 0.0 and 1.0 (including).
Color Model "GRAY255"5/KValue
The one components of the GRAY color model is separated by the character / (Ansi 47). The component may have integer values between 0 and 255 (including).
Color Model "HSB"6/HValue/SValue/BValue
The three components of the HSB color model are separated by the character / (Ansi 47). The first component may have integer values between 0 and 360 (including), the other two components may have floating point values between 0.0 and 1.0 (including).
Color Model "CIElab"7/LValue/AValue/BValue
The three components of the LAB color model are separated by the character / (Ansi 47). The first component may have floating point values between 0.0 and 100.0 (including), the second component may have floating point values between -150.0 and 150.0 (including), the third component may have floating point values between -150.0 and 150.0 (including).
Please note that values of type double and int may be empty, i.e. the value /// is a correct RGB value, it is equal to 0/0/0/0 or RGB 0/0/0 and represents the color black in the RGB color model! All fractional values will usually be stated without a leading zero, i.e. normally, the color "Gray 50%" will be stored as 4/.5 in the gray color model instead of 4/0.5.
Depending on the precision of the creating application, the component values of the examples above might not be exactly reproduced. If each component is stored in a 8 bit field, the value .5 might be exported as .498 or .502 . If no exact color match is needed, the application may round these values to 2 fractional digits. When exporting a color definition value, a format string such as %.3lg should be used to achieve a precision that will allow to handle 8 bit components without errors.
Examples for the RGB100 color model
Examples for the CMYK100 color model
|
CAD6interface 2024.2 - Copyright 2024 Malz++Kassner® GmbH