How to use the points object tikzpy.col

Examples of how to use the colors object tikzpy.col.

Example 1 - Define colors

Test code:

 1# python3
 2
 3import tikzpy
 4
 5### Load main object
 6tikZ = tikzpy.pytikz()
 7
 8### Add point at x=0, y=0, z=0
 9p0 = tikZ.pto.pto(0,0,0)
10
11### Add point at x=1, y=1, z=1
12p2 = tikZ.pto.pto(1,1,1)
13
14### Define custom color
15tikZ.col["custom_color_rgb"] = "150_50_5"
16tikZ.col["custom_color"] = "red!50"
17
18### Add a line for example
19l1 = tikZ.shp.line(p0, p2, color = "custom_color")
20
21print(l1)

This would output:

Line key:#s0 layer=0 points=2 NumLines:1