MCPcopy Index your code
hub / github.com/secdev/scapy / colgen

Function colgen

scapy/utils.py:1114–1128  ·  view source on GitHub ↗

Returns a generator that mixes provided quantities forever trans: a function to convert the three arguments into a color. lambda x,y,z:(x,y,z) by default

(*lstcol,  # type: Any
           **kargs  # type: Any
           )

Source from the content-addressed store, hash-verified

1112
1113
1114def colgen(*lstcol, # type: Any
1115 **kargs # type: Any
1116 ):
1117 # type: (...) -> Iterator[Any]
1118 """Returns a generator that mixes provided quantities forever
1119 trans: a function to convert the three arguments into a color. lambda x,y,z:(x,y,z) by default""" # noqa: E501
1120 if len(lstcol) < 2:
1121 lstcol *= 2
1122 trans = kargs.get("trans", lambda x, y, z: (x, y, z))
1123 while True:
1124 for i in range(len(lstcol)):
1125 for j in range(len(lstcol)):
1126 for k in range(len(lstcol)):
1127 if i != j or j != k or k != i:
1128 yield trans(lstcol[(i + j) % len(lstcol)], lstcol[(j + k) % len(lstcol)], lstcol[(k + i) % len(lstcol)]) # noqa: E501
1129
1130
1131def incremental_label(label="tag%05i", start=0):

Callers 3

canvas_dumpMethod · 0.90
trace3D_notebookMethod · 0.90
make_graphMethod · 0.90

Calls 1

getMethod · 0.45

Tested by

no test coverage detected