How to use the desert.box.from_json function in desert

To help you get started, we’ve selected a few desert examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github inconvergent / desert / examples / export.py View on Github external
def main():

  b = box(0.3, (0.3, 0.3), 1.0).rgb(rgb(0.1, 0.3, 0.4, 0.77)).json()
  pprint(b)
  pprint(box.from_json(b).json())
  pprint()

  s = stroke(((0.1, 0.1),
              (0.1, 0.1),
              (0.1, 0.9),
              (0.1, 0.1)),
             ((0.9, 0.9),
              (0.1, 0.9),
              (0.9, 0.9),
              (0.2, 0.15)), 2).rgb(black(0.4)).json()

  pprint(s)
  pprint(stroke.from_json(s).json())
  pprint()

  c = circle(0.05, ((0.5, 0.4), (0.8, 0.4)), 1.0).json()