Hey there,
I was wondering if there was a way to get the specific color of a pixel on the screen?
If there is, how would I go about using it?
Thanks,
- Sam
A way to get the color of a pixel?
Started by SGunner2014, Oct 03 2014 05:46 PM
4 replies to this topic
#1
Posted 03 October 2014 - 05:46 PM
#2
Posted 03 October 2014 - 05:50 PM
Unless you write a utility that saves the background/text color in some way, each time you call term.write(), there is no way to do that, no.
#3
Posted 03 October 2014 - 05:57 PM
wieselkatze, on 03 October 2014 - 05:50 PM, said:
Unless you write a utility that saves the background/text color in some way, each time you call term.write(), there is no way to do that, no.
I am drawing pixels using paintutils.drawPixel()
Does this change anything?
Thanks,
- Sam
#4
Posted 03 October 2014 - 06:03 PM
function drawPixel( xPos, yPos, nColour )
if type( xPos ) ~= "number" or type( yPos ) ~= "number" or type( nColour ) ~= "number" then
error( "Expected x, y, colour", 2 )
end
term.setBackgroundColor( nColour )
drawPixelInternal( xPos, yPos )
end
local function drawPixelInternal( xPos, yPos )
term.setCursorPos(xPos, yPos)
term.write(" ")
end
As you see you cant, but you can create table that will have everything saved. and print stuff from that table
#5
Posted 03 October 2014 - 07:18 PM
Okay, thanks. I'm going to store the whole thing in a table, and when it is needed to be saved, save all of the stuff in the table and there! Saved!
Many thanks,
- Sam
Many thanks,
- Sam
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











