PixCol

From Wiki
Jump to: navigation, search
Holds the color of the last pixel saved using savePix. The colors returned by #pixCol are in the format $BBGGRR (where BB = hex value of blue color channel, GG = hex value of green color channel, RR = hex value of red channel). All colors rendered on the screen are created from these 3 primary colors. Each color ranges from 0 (darkest) to 255 (brightest) -- or $00 to $FF.


Note:
  • The client window must be unobscured by other windows in order for savePix and #pixColor to work.
  • #pixCol values differ slightly from computer to computer.
  • Most of the content of this page is shamelessly ripped off from a post that Cedryk made in the CC forum. Thanks for the knowledge Cedryk! --Kedrick Valorite


Example


sub TestColor
; pass   %1   Color to Test
;   %2   Color to Match
;   %3   Channel Similarity
  set %_ct %1 
  set %_cm %2 
  set %_cs %3 
  gosub ColorChannels %_cm 
  set %_rm %r 
  set %_bm %b 
  set %_gm %g 
  gosub ColorChannels %_ct 
  set %_rd %r - %_rm abs
  set %_bd %b - %_bm abs
  set %_gd %g - %_gm abs
  set %_result ( %_rd <= %_cs ) && ( %_bd <= %_cs ) && ( %_gd <= %_cs ) 
return %_result

See Also

Miscellaneous Variables

  • These system variables are not easily categorized in any other category, and therefore are placed here.
#shard Returns which shard you are logged into
#date Returns the local date on your computer
#time Returns the local time on your computer
#sysTime Counts the number of milliseconds since 01/Jan/1980 UTC
#sCnt Timer in seconds since Windows boot
#sCnt2 Timer in tenths of seconds since Windows boot
#pixCol Returns the color of the pixel last saved with savePix
#cursorX Returns the x-coordinate of the cursor
#cursorY Returns the y-coordinate of the cursor
#random Holds a random number
#dispRes Returns button clicked in last call to display
#lShard Set the last shard of your choice
#osVer Returns the OS version
#euoVer Returns the current EasyUO version