The Canvas element is allows you to render arbitrary "pixels" also known as line-drawing characters.

Usage

Simple example of usage Canvas element.

use function Thermage\canvas;
use function Thermage\render;

// ...

$canvas = canvas();

for ($i=0; $i < 16; $i++) { 
    
    // Cross
    $canvas->pixel($i, $i, 'white');
    $canvas->pixel(16 - $i - 1, $i, 'white');

    // Border
    $canvas->pixel($i, 0, 'red');
    $canvas->pixel(0, $i, 'green');
    $canvas->pixel($i, 16 - 1, 'blue');
    $canvas->pixel(16 - 1, $i, 'yellow');
}

render(
  $canvas
);
Terminal
$ php thermage.php

Methods

d Set Canvas element display style.
pixel Set Canvas element pixel.
pixels Set Canvas element pixels.
pixelWidth Set Canvas element pixel width.
render Render Canvas element.
size Set Canvas element size.