Recently I came to the conclusion that a wider use of the compound color values in standard API functions would be very convenient. Currently, RGB encoded into single integer are used only in drawing functions: DrawBox, DrawEllipse, DrawLine. Palettes of such colors can be easily defined as simple constants set in ABGR format, for example:
// X11 colors palette
#constant color_Pink 0xFFCBC0FF
#constant color_LightPink 0xFFC1B6FF
#constant color_HotPink 0xFFB469FF
#constant color_DeepPink 0xFF9314FF
#constant color_PaleVioletRed 0xFF9370DB
#constant color_MediumVioletRed 0xFF8515C7
#constant color_LightSalmon 0xFF7AA0FF
#constant color_Salmon 0xFF7280FA
#constant color_DarkSalmon 0xFF7A96E9
#constant color_LightCoral 0xFF8080F0
#constant color_IndianRed 0xFF5C5CCD
#constant color_Crimson 0xFF3C14DC
#constant color_FireBrick 0xFF2222B2
#constant color_DarkRed 0xFF00008B
#constant color_Red 0xFF0000FF
#constant color_OrangeRed 0xFF0045FF
#constant color_Tomato 0xFF4763FF
#constant color_Coral 0xFF507FFF
#constant color_DarkOrange 0xFF008CFF
#constant color_Orange 0xFF00A5FF
#constant color_Yellow 0xFF00FFFF
#constant color_LightYellow 0xFFE0FFFF
#constant color_LemonChiffon 0xFFCDFAFF
#constant color_LightGoldenrodYellow 0xFFD2FAFA
#constant color_PapayaWhip 0xFFD5EFFF
#constant color_Moccasin 0xFFB5E4FF
#constant color_PeachPuff 0xFFB9DAFF
#constant color_PaleGoldenrod 0xFFAAE8EE
#constant color_Khaki 0xFF8CE6F0
#constant color_DarkKhaki 0xFF6BB7BD
#constant color_Gold 0xFF00D7FF
#constant color_Cornsilk 0xFFDCF8FF
#constant color_BlanchedAlmond 0xFFCDEBFF
#constant color_Bisque 0xFFC4E4FF
#constant color_NavajoWhite 0xFFADDEFF
#constant color_Wheat 0xFFB3DEF5
#constant color_BurlyWood 0xFF87B8DE
#constant color_Tan 0xFF8CB4D2
#constant color_RosyBrown 0xFF8F8FBC
#constant color_SandyBrown 0xFF60A4F4
#constant color_Goldenrod 0xFF20A5DA
#constant color_DarkGoldenrod 0xFF0B86B8
#constant color_Peru 0xFF3F85CD
#constant color_Chocolate 0xFF1E69D2
#constant color_SaddleBrown 0xFF13458B
#constant color_Sienna 0xFF2D52A0
#constant color_Brown 0xFF2A2AA5
#constant color_Maroon 0xFF000080
#constant color_DarkOliveGreen 0xFF2F6B55
#constant color_Olive 0xFF008080
#constant color_OliveDrab 0xFF238E6B
#constant color_YellowGreen 0xFF32CD9A
#constant color_LimeGreen 0xFF32CD32
#constant color_Lime 0xFF00FF00
#constant color_LawnGreen 0xFF00FC7C
#constant color_Chartreuse 0xFF00FF7F
#constant color_GreenYellow 0xFF2FFFAD
#constant color_SpringGreen 0xFF7FFF00
#constant color_MediumSpringGreen 0xFF9AFA00
#constant color_LightGreen 0xFF90EE90
#constant color_PaleGreen 0xFF98FB98
#constant color_DarkSeaGreen 0xFF8FBC8F
#constant color_MediumAquamarine 0xFFAACD66
#constant color_MediumSeaGreen 0xFF71B33C
#constant color_SeaGreen 0xFF578B2E
#constant color_ForestGreen 0xFF228B22
#constant color_Green 0xFF008000
#constant color_DarkGreen 0xFF006400
#constant color_Aqua 0xFFFFFF00
#constant color_Cyan 0xFFFFFF00
#constant color_LightCyan 0xFFFFFFE0
#constant color_PaleTurquoise 0xFFEEEEAF
#constant color_Aquamarine 0xFFD4FF7F
#constant color_Turquoise 0xFFD0E040
#constant color_MediumTurquoise 0xFFCCD148
#constant color_DarkTurquoise 0xFFD1CE00
#constant color_LightSeaGreen 0xFFAAB220
#constant color_CadetBlue 0xFFA09E5F
#constant color_DarkCyan 0xFF8B8B00
#constant color_Teal 0xFF808000
#constant color_LightSteelBlue 0xFFDEC4B0
#constant color_PowderBlue 0xFFE6E0B0
#constant color_LightBlue 0xFFE6D8AD
#constant color_SkyBlue 0xFFEBCE87
#constant color_LightSkyBlue 0xFFFACE87
#constant color_DeepSkyBlue 0xFFFFBF00
#constant color_DodgerBlue 0xFFFF901E
#constant color_CornflowerBlue 0xFFED9564
#constant color_SteelBlue 0xFFB48246
#constant color_RoyalBlue 0xFFE16941
#constant color_Blue 0xFFFF0000
#constant color_MediumBlue 0xFFCD0000
#constant color_DarkBlue 0xFF8B0000
#constant color_Navy 0xFF800000
#constant color_MidnightBlue 0xFF701919
#constant color_Lavender 0xFFFAE6E6
#constant color_Thistle 0xFFD8BFD8
#constant color_Plum 0xFFDDA0DD
#constant color_Violet 0xFFEE82EE
#constant color_Orchid 0xFFD670DA
#constant color_Fuchsia 0xFFFF00FF
#constant color_Magenta 0xFFFF00FF
#constant color_MediumOrchid 0xFFD355BA
#constant color_MediumPurple 0xFFDB7093
#constant color_BlueViolet 0xFFE22B8A
#constant color_DarkViolet 0xFFD30094
#constant color_DarkOrchid 0xFFCC3299
#constant color_DarkMagenta 0xFF8B008B
#constant color_Purple 0xFF800080
#constant color_Indigo 0xFF82004B
#constant color_DarkSlateBlue 0xFF8B3D48
#constant color_SlateBlue 0xFFCD5A6A
#constant color_MediumSlateBlue 0xFFEE687B
#constant color_White 0xFFFFFFFF
#constant color_Snow 0xFFFAFAFF
#constant color_Honeydew 0xFFF0FFF0
#constant color_MintCream 0xFFFAFFF5
#constant color_Azure 0xFFFFFFF0
#constant color_AliceBlue 0xFFFFF8F0
#constant color_GhostWhite 0xFFFFF8F8
#constant color_WhiteSmoke 0xFFF5F5F5
#constant color_Seashell 0xFFEEF5FF
#constant color_Beige 0xFFDCF5F5
#constant color_OldLace 0xFFE6F5FD
#constant color_FloralWhite 0xFFF0FAFF
#constant color_Ivory 0xFFF0FFFF
#constant color_AntiqueWhite 0xFFD7EBFA
#constant color_Linen 0xFFE6F0FA
#constant color_LavenderBlush 0xFFF5F0FF
#constant color_MistyRose 0xFFE1E4FF
#constant color_Gainsboro 0xFFDCDCDC
#constant color_LightGray 0xFFD3D3D3
#constant color_Silver 0xFFC0C0C0
#constant color_DarkGray 0xFFA9A9A9
#constant color_Gray 0xFF808080
#constant color_DimGray 0xFF696969
#constant color_LightSlateGray 0xFF998877
#constant color_SlateGray 0xFF908070
#constant color_DarkSlateGray 0xFF4F4F2F
#constant color_Black 0xFF000000
As for now, SetColor functions of elements such as Sprite, Text, Object, etc. accept only parameters passed as a list of separate components R, G, B, A, so compounds colors can not be used directly.
We need to use:
SetTextColor( text,
GetColorRed(color_MediumVioletRed),
GetColorGreen(color_MediumVioletRed),
GetColorBlue(color_MediumVioletRed), alpha )
instead just:
SetTextColor( text, color_MediumVioletRed, alpha )
I think it would be very handy to add overloaded variants of the functions (in addition to the existing ones) that accepts directly compound color value, like those:
Add3DParticlesColorKeyFrame (ID, time#, color, alpha) // 3DParticles, overloaded function
AddParticlesColorKeyFrame (ID, time#, color, alpha) // Particles, overloaded function
CreateImageColor (imageID, color, alpha) // Image, overloaded function
CreateImageColor (color, alpha): integer // Image, overloaded function
SetAmbientColor (color) // 3D, overloaded function
SetBorderColor (color) // Core, overloaded function
SetClearColor (color) // Core, overloaded function
SetEditBoxBackgroundColor (index, color, alpha) // Input, overloaded function
SetEditBoxBorderColor (index, color, alpha) // Input, overloaded function
SetEditBoxCursorColor (index, color) // Input, overloaded function
SetEditBoxTextColor (index, color) // Input, overloaded function
SetFogColor (color) // 3D, overloaded function
SetFogSunColor (color) // 3D, overloaded function
SetImageTransparentColor (iImage, color) // Image, overloaded function
SetMeshMemblockVertexColor (memID, vertexIndex, color, alpha) // Memblock, overloaded function
SetObjectColor (objID, color, alpha) // 3D, overloaded function
SetObjectColorEmissive (objID, color) // 3D, overloaded function
SetPointLightColor (lightID, color) // 3D, overloaded function
SetPrintColor (color) // Text, overloaded function
SetPrintColor (color, alpha) // Text, overloaded function
SetSkyBoxHorizonColor (color) // 3D, overloaded function
SetSkyBoxSkyColor (color) // 3D, overloaded function
SetSkyBoxSunColor (color) // 3D, overloaded function
SetSpriteColor (iSpriteIndex, color, alpha) // Sprite, overloaded function
SetSunColor (color) // 3D, overloaded function
SetTextCharColor (iTextIndex, iCharIndex, color, alpha) // Text, overloaded function
SetTextColor (iTextIndex, color, slpha) // Text, overloaded function
SetVirtualButtonColor (index, color) // Input, overloaded function
In addition, it would be practical if we could use the oldest bits of compound color for the alpha value (the alpha component could simply be ignored by functions that only use RGB, or those in which the alpha is specified separately), i.e. we need the functions:
MakeColor (red, green, blue, alpha): integer // Core, overloaded function, returns compound color with alpha component
GetColorAlpha (color): integer // Core, NEW function, returns alpha component of compound color
GetSpriteColor (iSpriteIndex:integer): integer // Sprite, NEW function, returns compound color (with alpha)
GetTextColor (iTextIndex:integer): integer // Text, NEW function, returns compound color (with alpha)
GetTextCharColor (iTextIndex:integer, iCharIndex:integer): integer // Text, NEW function, returns compound color (with alpha)
GetMeshMemblockVertexColor (memID:integer, vertexIndex:integer): integer // Memblock, NEW function, returns compound color (with alpha)
All the above proposed changes are not really important or nescessary (they can be easily written in Basic), but if they were added to API, it would improve the slightly "quality of life" parameter