Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

distance

rerere284 Apr 12th, 2016 (edited) 126 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. --made by rerere284
  2. function init()
  3.     setName("Distance")
  4.     setDesc("Gets the distance between two numbers")
  5.     setSize(100, 24+64+8+8+18+7+4)
  6.     addOutput(24+32)
  7.     addInputParameter("First", "First Number", 24+64+8+8, 1, -1, -1)
  8.     addInputParameter("Second", "Second Number", 24+64+8+8+18, 1, -1, -1)
  9. end
  10.  
  11. function apply()
  12.     tileSize = getTileSize()
  13.     for i=0, tileSize*tileSize-1 do
  14.         x = i%tileSize
  15.         y = math.floor(i/tileSize)
  16.         ar, ag, ab = getValue(0, x, y, 100.0) --get pixels at that location
  17.         br, bg, bb = getValue(1, x, y, 100.0)
  18.         fr = math.abs(ar - br)
  19.         fg = math.abs(ag - bg)
  20.         fb = math.abs(ab - bb)
  21.         setPixel(0, x, y, fr, fg, fb)
  22.     end
  23. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top