Wiki

Clone wiki

Core / fill

Back to Beyond the Codea in-app reference


FunctionIconFunction-Small.png fill() function

Introduction

The 'Graphics' chapter of Codea's in-app reference documents most of the fill() function. The function sets or returns the colour used:

  1. to fill shapes drawn with the ellipse() and rect() functions;
  2. to set the colour of text drawn with the text() function; and
  3. to set the colours of all the vertices of meshes where they are not otherwise set.

The default fill() colour

The default fill() colour is an opaque grey. For example:

function setup()
    r, b, g, a = fill()
    print(r, b, g, a) -- Outputs 127     127     127     255
    fill(255, 0, 0, 255) -- Set fill colour to opaque red
end

Updated