ComputerCraft

ComputerCraft

21M Downloads

2 Issues with the setPaletteColor function

IliasHDZ1 opened this issue ยท 2 comments

commented

I found 2 issues.

Issue 1
If you change the color of for example colors.yellow.
After that you cannot change the same color colors.yellow to another color.
You can only change the color of an color one time.

Issue 2
If you change the color of for example colors.yellow higher than 16 ( 16 is the limit)
Example: term.setPaletteColor( colors.yellow, *17*, 16, 5)
It wil continue as if the color is 16 instead of 17.
I think it needs an error instead of that.

commented

After that you cannot change the same color colors.yellow to another color.

ComputerCraft only has 16 colours. This means there can only be 16 different colours on-screen at any given time. When you use setPaletteColour, you reassign the RGB value of the colour you chose. So of course, you can't change the same colour twice, and expect to get two different colours. You have to choose a different colour for your second one.

If you change the color of for example colors.yellow higher than 16 ( 16 is the limit). Example: term.setPaletteColor( colors.yellow, *17*, 16, 5)

term.setPaletteColor uses values between 0 and 1 instead, so anything above 1 will be ignored, be it 16 or 17.

commented

term.setPaletteColor uses values between 0 and 1 instead, so anything above 1 will be ignored, be it 16 or 17.

Last I checked, it'd accept higher values without complaint. Sure they might not work as the average user would expect, but it certainly didn't "ignore" them.