MCPcopy Create free account
hub / github.com/FastLED/FastLED / toJson

Method toJson

examples/Chromancer/gen.py:40–49  ·  view source on GitHub ↗
(points: list["Point"])

Source from the content-addressed store, hash-verified

38
39 @staticmethod
40 def toJson(points: list["Point"]) -> list[dict]:
41 x_values = [p.x for p in points]
42 y_values = [p.y for p in points]
43 # round
44 x_values = [round(x, 4) for x in x_values]
45 y_values = [round(y, 4) for y in y_values]
46 if MIRROR_X:
47 x_values = [-x for x in x_values]
48
49 return {"x": x_values, "y": y_values, "diameter": LED_DIAMETER}
50
51 def copy(self) -> "Point":
52 return Point(self.x, self.y)

Callers 1

unit_testFunction · 0.45

Calls 1

roundFunction · 0.85

Tested by

no test coverage detected