Skip to main content

Set the color of a pixel (:set_color)

Declaration

img = img:set_color(x, y, color)

Parameters

  • x, y
    Integer. Coordinates of the pixel in the current image
  • color
    Integer. Color value to set

Returns

  • img
    Image object. Returns the image object itself after setting the color

Description

Set the color of a pixel in an image
Mutates the image in-place
Performance: no data copy during operation