Reference · SVG faces and looks
blockSvgfunction
The block drawn behind a face: the back plate and the ivory layer in steps from the far side to the face, and the
shading of the sides (the side the light falls on lighter, the other darker). The face is drawn over it by the caller.
For a tile seen from its back (side: "back") the back plate is the near layer and the ivory the far one.
Import it
import { blockSvg } from "@johnmorrisdotca/jarajara/faces";
Definition
function blockSvg(colours: BlockColours, direction: BlockDirection, side?: "face" | "back"): string
Parameters
| Name | Type | Description |
|---|---|---|
colours | BlockColours | The solid tile block’s colours. |
direction | BlockDirection | The horizontal and vertical orientation of the block. |
side (optional) | "face" | "back" | Whether to show the face or the back. |
Returns
string
The block drawn behind a face: the back plate and the ivory layer in steps from the far side to the face, and the shading of the sides (the side the light falls on lighter, the other darker). The face is drawn over it by the caller. For a tile seen from its back (side: "back") the back plate is the near layer and the ivory the far one.
Examples
import { blockColours, blockSvg } from "@johnmorrisdotca/jarajara/faces";
console.log(blockSvg(blockColours(),{x:1,y:1}).length);537What it prints (run when this page was built)