Jump to content

Invert RGB hex


Recommended Posts

How do you invert RGB hex codes? I can't do it one by one because it's going to be on a massive scale (like 10000)

Theres probably something right in my face but I'm not thinking too well at 1am.

Thanks

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

I understand the subtracting the RGB colors, which is much easier so I'll just change my cript to us that instead of hex... but down below it says to multiply r by 255.... I didn't know you could multiply numbers by letters, but I'll look into it tomorrow, thanks

EDIT: haha, what am I thinking... RGB isin't a color mode in autoit.....

so I guess that means I'm stuck back at square one... anyway, I'll get back to it after I've had some rest... writing scripts is addicting, although I don't understand how I spend 3 hours on 159 lines of script....

Edited by VindicatorOmega

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

Link to comment
Share on other sites

I've written a script few days ago to do this to the whole screen :P sadly it's to slow to be a real effect :P but maybe it can also help.

$dll = DllOpen("Gdi32.dll")
$hwnd = DllCall("user32.dll", "hwnd", "GetActiveWindow")
$dc = DllCall("user32.dll", "hwnd", "GetDC", "hwnd", $hwnd[0])
For $i = 0 to @DesktopWidth 
    For $j = 0 to @DesktopHeight
        $rgb = DllCall($dll, "int", "GetPixel", "hwnd", $dc[0], "int", $i, "int", $j)
        $rgb[0] = BitNOT("0x" & Hex($RGB[0]))
        DllCall($dll, "int", "SetPixel", "hwnd", $dc[0], "int", $i, "int", $j, "int", "0x00" & StringTrimLeft(Hex($rgb[0]), 2))
    Next
Next    
DllClose($dll)

If you have an idea how it can be done quicker let me know ;P

Edited by CHronologist
Link to comment
Share on other sites

I've written a script few days ago to do this to the whole screen :P sadly it's to slow to be a real effect :P but maybe it can also help.

$dll = DllOpen("Gdi32.dll")
$hwnd = DllCall("user32.dll", "hwnd", "GetActiveWindow")
$dc = DllCall("user32.dll", "hwnd", "GetDC", "hwnd", $hwnd[0])
For $i = 0 to @DesktopWidth 
    For $j = 0 to @DesktopHeight
        $rgb = DllCall($dll, "int", "GetPixel", "hwnd", $dc[0], "int", $i, "int", $j)
        $rgb[0] = BitNOT("0x" & Hex($RGB[0]))
        DllCall($dll, "int", "SetPixel", "hwnd", $dc[0], "int", $i, "int", $j, "int", "0x00" & StringTrimLeft(Hex($rgb[0]), 2))
    Next
Next    
DllClose($dll)

If you have an idea how it can be done quicker let me know ;P

Well, you can do it like a TV screen, have one script do every OTHER vertical line, and another do the ones it missed Edited by VindicatorOmega

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

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...