Change color values of an Int color?

Miscellaneous Forums/General Discussion/Change color values of an Int color?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Well to get back to Component Colors, it's

alpha = (argb shr 24) and 255
red = (argb shr 16) and 255
green = (argb shr 8) and 255
blue = (argb and 255)


Then to get them back to an int

argb = (alpha shl 24) or (red shl 16) or (green shl 8) or (blue)


So I guess you would grab the green, blue and alpha, and make a new argb int with those and your new red value.

EDIT: And, of course, if it's BlitzMax, it's & and | rather than "And" and "Or" but I'm sure you already knew that.