diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6d84556b24..5430b052cb 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,12 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-04-08 07:48 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbxbp/xbpgra.prg + ! GraGetRGBIntensity() function body updated with code sent by Shum + after applying formatting and variable declaration optimization. + UNTESTED. + 2010-04-08 00:32 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt) * harbour/contrib/sddodbc/sddodbc.c + VARBINARY, LONGVARBINARY type support diff --git a/harbour/contrib/hbxbp/xbpgra.prg b/harbour/contrib/hbxbp/xbpgra.prg index 82933016f2..2ac3e26e76 100644 --- a/harbour/contrib/hbxbp/xbpgra.prg +++ b/harbour/contrib/hbxbp/xbpgra.prg @@ -149,9 +149,16 @@ FUNCTION GraFocusRect( oPS, aStartPoint, aEndPoint ) /*----------------------------------------------------------------------*/ FUNCTION GraGetRGBIntensity( nRGBColor ) - LOCAL aRGB := {} + LOCAL aRGB, cRGBHex - HB_SYMBOL_UNUSED( nRGBColor ) + IF nRGBColor == NIL + nRGBColor := 0 + ENDIF + + cRGBHex := HB_HexToStr( HB_NumToHex( nRGBColor ) ) + cRGBHex := PADL( cRGBHex, 6, "0" ) + aRGB := { SubStr( cRGBHex, 1, 2 ), SubStr( cRGBHex, 3, 2 ), SubStr( cRGBHex, 5, 2 ) } + aRGB := { HB_HexToNum( aRGB[ 1 ] ), HB_HexToNum( aRGB[ 2 ] ), HB_HexToNum( aRGB[ 3 ] ) } RETURN aRGB