Color of a screen pixel: Difference between revisions

Content added Content deleted
No edit summary
Line 482: Line 482:
SHOW PIXEL
SHOW PIXEL
[255 255 255]
[255 255 255]
=={{header|M2000 Interpreter}}==
Colors is M2000 have a negative value for RGB, or positive for default colors (0 to 15 are the default colors). Also numbers above 0x80000000 (is a positive number), are Windows colors too. Point return a negative value so we have to make it positive to get the RGB value where Red is the least significant byte. Html color has R as the most significant byte (of three), so to display properly we have to use a mix of Right$(),Mid$() and Left$() functions on string representation on color$.
<lang M2000 Interpreter>
Module CheckColor {
\\ Print hex code for color, and html code for color
Every 25 {
move mouse.x, mouse.y
color$=Hex$(-point, 3) ' point has a negative value
Print Over "0x"+color$+", #"+Right$(color$,2)+Mid$(color$, 3,2)+Left$(color$,2)
if mouse<>0 then exit
}
Print
}
CheckColor
</lang>


=={{header|Mathematica}}==
=={{header|Mathematica}}==