Line
Creating a Line
You can create a line in Ehhlang using the line
keyword. The line
keyword is followed by the start and end positions of the line, thickness, and color of the line. For example, to create a line from position (100, 100) to position (200, 200) with thickness 5 and the white color, you can use the following code:
Output:
In the above example, we have created a line from position (100, 100) to position (200, 200) with thickness 5 and the white color.
Properties
The line has the following properties:
startPosition
: The start position of the line. The position is specified in the formatX, Y
.endPosition
: The end position of the line. The position is specified in the formatX, Y
.thickness
: The thickness of the line. The default thickness is 1.color
: The color of the line. The color is specified in RGB formatR, G, B
.
Conclusion
A line is a straight one-dimensional figure having no thickness and extending infinitely in both directions. You can create a line in Ehhlang using the line
keyword and specify the start and end positions, thickness, and color of the line. This helps you to create images with different lines and colors.