EhhLang Help

Rectangle

Creating a Rectangle

You can create a rectangle in Ehhlang using the rect keyword. The rect keyword is followed by the position, width, height, and color of the rectangle. For example, to create a rectangle at position (100, 100) with width 200, height 100, and the white color, you can use the following code:

ehh { width: 840 height: 480 background: 0, 0, 0 output: "Rectangle.png" } rect { position: 100, 100 width: 200 height: 100 color: 255, 255, 255 }

Output:

Rectangle

In the above example, we have created a rectangle at position (100, 100) with width 200, height 100, and the white color.

Properties

The rectangle has the following properties:

  • position: The position of the rectangle. The position is specified in the format X, Y.

  • width: The width of the rectangle.

  • height: The height of the rectangle.

  • color: The color of the rectangle. The color is specified in RGB format R, G, B.

  • thickness: The thickness of the rectangle. The default thickness is 1.

  • fillColor: The fill color of the rectangle. The fill color is specified in RGB format R, G, B. It can be set to no if it is inherited from a rectangle that has fill color and the current object doesn't want to inherit it.

Conclusion

A rectangle is a four-sided polygon with four right angles. You can create a rectangle in Ehhlang using the rect keyword and specify the position, width, height, color, thickness, and fill color of the rectangle. This helps you to create images with different rectangles and colors.

Last modified: 25 February 2024