cancel
Showing results for 
Search instead for 
Did you mean: 

matrix column color codes

Former Member
0 Kudos

Hi,

I've some difficulties to set the color of a matrix column.

I've tried to convert to integer an hexa color code (like #FF0000)

or using System.Drawing.Color.MyColor.ToArgb()

In both case the color of the column doesn't match the color I specify.

For example using LightSkyBlue give me an orange column.

Thanks for your help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The color is based in RGB representation (red - green - blue). Each part of rgb is in range 0 - 255. For example full red color is 255 - 0 - 0 and this values converted in hexa is FF0000 and this hexa value you must convert back to decimal.

From UI help:

RGB value in long representation. You can use the standard Visual Basic colors, for example, vbBlue, vbYellow, etc.

The valid range for a normal RGB color is 0 to 16,777,215 (&HFFFFFF).

Former Member
0 Kudos

Thanks Petr,

This is was I thought but it's not true.

For example i want the color 255, 207, 49 (SAP light orange)

in hexa : ffcf31

in decimal : 16764721

with this value my column appears blue.

Maybe there it's a complementary color problem..

Former Member
0 Kudos

I tried it and you are true. BTW, I doing it so - in screen painter i add one edittext and set to it background color in rgb specification (with choose more in select) - then I save the form and with notepad I see, which value is sets there.

For your combination of rgb its 3198718.

Former Member
0 Kudos

I totaly forgot how I made it in the past in non sap forms. There is calculation as

Private Sub Command1_Click()

r = Val(InputBox$("Red Value"))

B = Val(InputBox$("Blue Value"))

G = Val(InputBox$("Green Value"))

*Lng$ = B * 65536 + G * 256 + r*

MsgBox Lng$

End Sub

there is no conversion to hex, just multiplication.

Edited by: Petr Verner on Jul 24, 2008 3:50 PM

Former Member
0 Kudos

Thank you very much Petr, it works fine!

Have a nice day.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi. Perhaps why does SAP use colours set up by the menu Window's> Color.

Former Member
0 Kudos

No , there isn't relation with this menu and a matrix color.