Hi,
Run this program first:
clg color 0xffffff plot 1,1 print pixel(1,1)
The result is 0. So it should be, because painter try to paint with full transparent color.
In the current version, user cannot change a pixel with desired value.
Let's give you a task: complete the code below in order to change the pixel (1,1) with given values and without changing other pixels.
clg rgb(51, 79, 31, 129) # your code here... # task1: change to rgb(1,2,3,0) - hex: 0x10203 # task2: change to rgb(17,213,19,201) - hex: 0xc911d513 print tohex(pixel(1,1)) #let's verify
The first task is impossible.
Even the second...
clg rgb(51, 79, 31, 129) #solution color clear plot 1,1 #clear the place color 0xc911d513 plot 1,1 #try to set the desired color print tohex(pixel(1,1)) #this print 0xc910d513, not given value 0xc911d513
Even this solution for second task is not working. The pixel value is 0xc910d513, not 0xc911d513!
So, we need an opposite command for pixel function.
There are 2 options:
1) overload existing pixel function like this:
pixel(x,y) - return value
pixel(x,y,color) - set the pixel with color value
2) or add a new statement:
setpixel(x,y) - set pixel with current color
setpixel(x,y,color) - set pixel with given color
It is just an idea.
Respectfully,
Florin Oprea
I am looking into this one. With many pixel values this works as expected. I am wondering why we are having problems with just specific values. Let's not create new statements if it is a different underlying issue.