This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
AlkamlBan's profile picture

Detect Colors

Started by AlkamlBan, 12 June 2014 - 09:53 AM
AlkamlBan #1
Posted 12 June 2014 - 11:53 AM
Hello I just wanted to ask a simple question:
Is there a command that will eneble me to detect what color is a specific pixel painted with?
I mean being able to detect a red "pixel" and getting its color so that it may be later processed.I could also use like a piece of code not a command itself but I really want to know if there is so if you can help, please post a reply
CometWolf #2
Posted 12 June 2014 - 12:22 PM
You'd have to overwrite the write function to log the color in a 2d table. Im more curious as to why you would need such a thing though, chances are there's a simpler solution.
KingofGamesYami #3
Posted 12 June 2014 - 02:21 PM
You would have to overwrite:

term.setBackgroundColor()   --#since we don't have any way of getting the color
term.write()  --#since we cannot directly ask the terminal
to log them in a 2d table as CometWolf said.
AlkamlBan #4
Posted 14 June 2014 - 09:36 PM
You would have to overwrite:

term.setBackgroundColor()   --#since we don't have any way of getting the color
term.write()  --#since we cannot directly ask the terminal
to log them in a 2d table as CometWolf said.

The reason I asked is because if there were such a thing it could help make "lights" you know… for games. like a flashlight for example which as you move lights different areas
theoriginalbit #5
Posted 15 June 2014 - 02:59 AM
it would just be easier to track the positions of the lights in a table.