Jump to content

Hex. RGB to Dec. RGB array


Recommended Posts

I need to get the values of the string(hex RGB) on certain positions.

for example, I want $R=AA by getting the AA from AABB0A

then, i want $R=AA=10*16+10=170

all i want are the decimal RGB values of a hex RGb value , ex. (256, 110, 23)

Can anyone help me?

I rule the world, bow in my honor.no, im not Zezima, but i bow down in his honor
Link to comment
Share on other sites

Or maybe this one?

#552225

That is an ugly piece of code.

This is as simple as it gets.

$nColor = 0xAABB0A
 $Blue = BitAND($nColor, 0xFF)
 $Green = BitAND(BitShift($nColor, 8), 0xFF)
 $Red = BitAND(BitShift($nColor, 16), 0xFF)
 
 ConsoleWrite("Red: " & $Red & " Green: " & $Green & " Blue: " & $Blue & @CRLF)
Edited by weaponx
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...