Address individual color values in RGBSurfacr

I want to address the individual color values from a RGBSurface.Pixel. How to do that? RGBSurface.Pixel(x,y).Red = MyRedValue or RGBSurface.Pixel.Red(x,y) = MyRedValue does not compile.

They are read only values.
You need to extract them , then create a new color from the revised values, something like this…

RGBSurface.Pixel(x,y) = rgb(Myredvalue, RGBSurface.Pixel(x,y).green,RGBSurface.Pixel(x,y).blue)

Ah yes ofcourse. Thanks!