Spikey0000 Posted August 15, 2008 Share Posted August 15, 2008 Hi all, What I want to accomplish is the following: Using the color of a pixel as reference, I want to update an array of colors so that if the reference pixel changes color, my array will change by the same amount. Hope that made sense. The following code does not work properly... please help. $new_background = Hex(PixelGetColor(200,790), 6) if $background_color <> $current_background Then For $i = 0 to $count Step 1 $color[$i] = $color[$i] -$background_color + $new_background Next $background_color = $new_background Link to comment Share on other sites More sharing options...
Uriziel01 Posted August 15, 2008 Share Posted August 15, 2008 Isnt this better: if Hex(PixelGetColor(200,790), 6) <> $background_color then $background_color=Hex(PixelGetColor(200,790), 6) $difference=$color[$i]-$background_color $color[$i]=$color[$i]+$difference endif It is only an simple example code, but You have the Idea? Helped? Link to comment Share on other sites More sharing options...
Spikey0000 Posted August 15, 2008 Author Share Posted August 15, 2008 I've modified the code to the idea above, but it's not working. I've used the debug feature. New Background: 64636A, Old Background: 6F6E76 Old Color: 6E2610 New Color: 0 Old Color: 39221C New Color: 0 Here is the code $current_background = Hex(PixelGetColor(200,790), 6) if $background_color <> $current_background Then _DebugOut ("New Background: " & $current_background & ", Old Background: " & $background_color, 0) For $i = 0 to $count Step 1 _DebugOut ("Old Color: " & $color[$i], 0) $difference = $current_background - $background_color $color[$i] = $color[$i] + $difference _DebugOut ("New Color: " & $color[$i], 0) Next $background_color = $current_background Please help~ Link to comment Share on other sites More sharing options...
Spikey0000 Posted August 15, 2008 Author Share Posted August 15, 2008 can anyone help? Link to comment Share on other sites More sharing options...
Spikey0000 Posted August 16, 2008 Author Share Posted August 16, 2008 Can anyone point me in the right direction? is it related to RBG colors? Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now