Ehhlang Basic Syntax
Introduction
Ehhlang is a domain specific language (DSL) to create images. It is designed to be simple and easy to use. This document will cover the basic syntax of Ehhlang and how to use it.
Basic Syntax
We can learn about basic Ehhlang syntax using the following example
Canvas (ehh):
Canvas is the main block of Ehhlang. It is used to define the canvas properties like width, height, background color, and output file name.
width: Width of the canvas
height: Height of the canvas
background: Background color of the canvas
output: Output file name
Objects:
Objects are the elements that are drawn on the canvas. In the above example, we have used the text object to draw the text on the canvas.
fontScale: Font size of the text
thickness: Thickness of the text
color: Color of the text
position: Position of the text
text: Text to be drawn
Properties:
Properties are the attributes of the objects. In the above example, we have used the
fontScale
,thickness
,color
,position
, andtext
properties of thetext
object.Inheritance (::):
Inheritance is used to create a new object from an existing object. In the above example, we have used the
::
operator to create a new objectHelloEhh
from the existing objecttext
.