Jump to content
Sign in to follow this  
RunescapeNerd

Hex. RGB to Dec. RGB array

Recommended Posts

RunescapeNerd

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

Share this post


Link to post
Share on other sites
weaponx

Open up C:\Program Files\AutoIt3\Include\Color.au3, there are three simple functions at the bottom that will provide what you need.

Share this post


Link to post
Share on other sites
Polyphem

Or maybe this one?

#552225


This post will be edited again by Polyphem: Tomorrow, 11:55 AM

Share this post


Link to post
Share on other sites
weaponx

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

Share this post


Link to post
Share on other sites
Polyphem

That is an ugly piece of code.

Me > :P

You > :P

...as always a pleasure to help...


This post will be edited again by Polyphem: Tomorrow, 11:55 AM

Share this post


Link to post
Share on other sites
RunescapeNerd

thanks


I rule the world, bow in my honor.no, im not Zezima, but i bow down in his honor

Share this post


Link to post
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
Sign in to follow this  

×