Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --INIT
- maxT=400
- R=254
- G=215
- B=161
- --Scale Factor, 1 = no scale
- adjustVal=1
- --Range loop, finds range of TMPs on the screen from 400
- for i in sim.parts(i) do
- if sim.partProperty(i,"type")==17 and sim.partProperty(i,"tmp")>maxT then
- maxT=sim.partProperty(i,"tmp")
- end
- end
- --Range calculations
- range=(maxT-400)*adjustVal
- dsizeR=range/R
- dsizeG=range/G
- dsizeB=range/B
- --Set dcolour
- for i in sim.parts(i) do
- if sim.partProperty(i,"type")==17 then
- if sim.partProperty(i,"tmp")<=0 then
- color=0xFF000000+(0x0010000*R)+(0x00000100*G)+(0x00000001*B)
- else
- color=0xFF000000+((0x00000001)*(B-(math.floor((sim.partProperty(i,"tmp")-400)/dsizeB))))+((0x00000100)*(G-(math.floor((sim.partProperty(i,"tmp")-400)/dsizeG))))+((0x00010000)*(R-(math.floor((sim.partProperty(i,"tmp")-400)/dsizeR))))
- end
- sim.partProperty(i, "dcolour", color)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement