+ Add examples to README

This commit is contained in:
Nils Dagsson Moskopp 2023-03-20 00:50:08 +01:00
parent efd3817f46
commit eca23daa85
1 changed files with 34 additions and 0 deletions

View File

@ -118,6 +118,40 @@ Pixels tables contains tables that represent scanlines.
The number of scanlines equals the height of an image.
Examples:
.. code::
-- white “:” on black background
local pixels_grayscale = {
{ { 0x00 }, { 0xFF }, { 0x00 } },
{ { 0x00 }, { 0x00 }, { 0x00 } },
{ { 0x00 }, { 0xFF }, { 0x00 } },
}
-- blue “x” on red background
local _ = { 200, 0, 0 }
local x = { 0, 0, 200 }
local pixels_rgb = {
{ x, _, _, _, x },
{ _, x, _, x, _ },
{ _, _, x, _, _ },
{ _, x, _, x, _ },
{ x, _, _, _, x },
}
-- green “+” on blue 50% opacity background
local _ = { 0, 0, 255, 127 }
local x = { 0, 255, 0, 255 }
local pixels_rgba = {
{ _, _, x, _, _ },
{ _, _, x, _, _ },
{ x, x, x, x, x },
{ _, _, x, _, _ },
{ _, _, x, _, _ },
}
Scanline Tables
^^^^^^^^^^^^^^^