From eca23daa85af72f7d5447964620afe153d8b8171 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Mon, 20 Mar 2023 00:50:08 +0100 Subject: [PATCH] + Add examples to README --- README.rst | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.rst b/README.rst index 4f2a574..9412770 100644 --- a/README.rst +++ b/README.rst @@ -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 ^^^^^^^^^^^^^^^