[futurebasic] HEXed-VEXed

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 1998 : Group Archive : Group : All Groups

From: warren <wfurman@...>
Date: Thu, 2 Apr 1998 12:15:55 -0500 (EST)
-------------------------------------------------------
Converting decimal color values to web values and back.
-------------------------------------------------------

Decimal to hex:
red# = 65355
red = red#/256
redHEX$ = HEX$(red/16) + RIGHT(HEX$(red MOD 16),1)

And back to decimal:
redDEC$ = "&H" + redHEX$
redDEC = VAL(redDEC$)
redDEC# = redDEC*256

-------------------------------------------------------
Anyone know what am I doing wrong?

-Warren