teamblue-e2 / enigma2

GNU General Public License v2.0
1 stars 18 forks source link

struct gRGB in gpixmap.h seems to parse hex values in colorstring wrongly #29

Open Quad-HK opened 3 years ago

Quad-HK commented 3 years ago

Describe the bug Instanciating a gRGB struct with a colorstring which includes 0xA to 0xF digits results in a wrong value.

To Reproduce Steps to reproduce the behavior: gRGB colr = gRGB("12345678); results in: colr.value = 305419896, colr.a = 18, colr.r = 52, colr.g = 86, colr.b = 120 which is the expected behaviour colr = gRGB( "ABCD5678" ); results in: colr.value = 305419896, colr.a = 18, colr.r = 52, colr.g = 86, colr.b = 120 which produces the same result as above with a completely different stringcolor value.

Expected behavior colr = gRGB( "ABCD5678" ); should result in: colr.value = 2882360952, colr.a = 171, colr.r = 205, colr.g = 86, colr.b = 120

Additional context The cause of this behaviour seems to reside here: https://github.com/teamblue-e2/enigma2/blob/57c058de905457ea569d9ae7fe1cc15fffaffd6d/lib/gdi/gpixmap.h#L45 'A' & 0x0f will result in 0x01 instead of 0x0a, 'B' & 0x0f in 0x02 instead of 0x0b, etc.

teamblue-e2 commented 2 years ago

Is this problem fixed yet?