# Path: magical/style.py
# COLOURS_RGB = {
#     # I'm using Berkeley-branded versions of RGBY from
#     # https://brand.berkeley.edu/colors/ (lightened).
#     'blue': lighten_rgb(rgb(0x3B, 0x7E, 0xA1), 1.7),  # founder's rock
#     'yellow': lighten_rgb(rgb(0xFD, 0xB5, 0x15), 1.7),  # california gold
#     'red': lighten_rgb(rgb(0xEE, 0x1F, 0x60), 1.7),  # rose garden
#     'green': lighten_rgb(rgb(0x85, 0x94, 0x38), 1.7),  # soybean
#     'grey': rgb(162, 163, 175),  # cool grey (not sure which one)
#     'brown': rgb(224, 171, 118),  # buff
# }
# 
# GOAL_LINE_THICKNESS = 0.01
# 
# ROBOT_LINE_THICKNESS = 0.01
# 
# SHAPE_LINE_THICKNESS = 0.015
# 
# def darken_rgb(rgb):
#     """Produce a darker version of a base colour."""
#     h, l, s = colorsys.rgb_to_hls(*rgb)
#     hls_new = (h, max(0, l * 0.9), s)
#     return colorsys.hls_to_rgb(*hls_new)
# 
# def lighten_rgb(rgb, times=1):
#     """Produce a lighter version of a given base colour."""
#     h, l, s = colorsys.rgb_to_hls(*rgb)
#     mult = 1.4**times
#     hls_new = (h, 1 - (1 - l) / mult, s)
#     return colorsys.hls_to_rgb(*hls_new)


import abc
import enum
import math
import weakref
import numpy as np
import pymunk as pm
import pymunk.autogeometry as autogeom
import magical.geom as gtools
import magical.gym_render as r
from magical.style import (
    COLOURS_RGB, GOAL_LINE_THICKNESS, ROBOT_LINE_THICKNESS,
    SHAPE_LINE_THICKNESS, darken_rgb, lighten_rgb)
            shape = pm.Poly(body, poly_verts)
            shapes = [shape]
            del shape

        for shape in shapes:
            shape.friction = 0.5
            self.add_to_space(shape)

        trans_joint = pm.PivotJoint(self.space.static_body, body, (0, 0),
                                    (0, 0))
        trans_joint.max_bias = 0
        trans_joint.max_force = self.phys_vars.shape_trans_joint_max_force
        self.add_to_space(trans_joint)
        rot_joint = pm.GearJoint(self.space.static_body, body, 0.0, 1.0)
        rot_joint.max_bias = 0
        rot_joint.max_force = self.phys_vars.shape_rot_joint_max_force
        self.add_to_space(rot_joint)

        # Drawing
        if self.shape_type == ShapeType.SQUARE:
            geoms_inner = [r.make_square(side_len - 2 * SHAPE_LINE_THICKNESS)]
            geoms_outer = [r.make_square(side_len)]
        elif self.shape_type == ShapeType.CIRCLE:
            geoms_inner = [
                r.make_circle(radius=self.shape_size - SHAPE_LINE_THICKNESS,
                              res=100),
            ]
            geoms_outer = [r.make_circle(radius=self.shape_size, res=100)]
        elif self.shape_type == ShapeType.STAR:
            star_short_verts = gtools.compute_star_verts(

# Path: magical/style.py
# COLOURS_RGB = {
#     # I'm using Berkeley-branded versions of RGBY from
#     # https://brand.berkeley.edu/colors/ (lightened).
#     'blue': lighten_rgb(rgb(0x3B, 0x7E, 0xA1), 1.7),  # founder's rock
#     'yellow': lighten_rgb(rgb(0xFD, 0xB5, 0x15), 1.7),  # california gold
#     'red': lighten_rgb(rgb(0xEE, 0x1F, 0x60), 1.7),  # rose garden
#     'green': lighten_rgb(rgb(0x85, 0x94, 0x38), 1.7),  # soybean
#     'grey': rgb(162, 163, 175),  # cool grey (not sure which one)
#     'brown': rgb(224, 171, 118),  # buff
# }
# 
# GOAL_LINE_THICKNESS = 0.01
# 
# ROBOT_LINE_THICKNESS = 0.01
# 
# SHAPE_LINE_THICKNESS = 0.015
# 
# def darken_rgb(rgb):
#     """Produce a darker version of a base colour."""
#     h, l, s = colorsys.rgb_to_hls(*rgb)
#     hls_new = (h, max(0, l * 0.9), s)
#     return colorsys.hls_to_rgb(*hls_new)
# 
# def lighten_rgb(rgb, times=1):
#     """Produce a lighter version of a given base colour."""
#     h, l, s = colorsys.rgb_to_hls(*rgb)
#     mult = 1.4**times
#     hls_new = (h, 1 - (1 - l) / mult, s)
#     return colorsys.hls_to_rgb(*hls_new)


# Path: magical/entities.py
import abc
import enum
import math
import weakref
import numpy as np
import pymunk as pm
import pymunk.autogeometry as autogeom
import magical.geom as gtools
import magical.gym_render as r
from magical.style import (
    COLOURS_RGB, GOAL_LINE_THICKNESS, ROBOT_LINE_THICKNESS,
    SHAPE_LINE_THICKNESS, darken_rgb, lighten_rgb)

            shape = pm.Poly(body, poly_verts)
            shapes = [shape]
            del shape

        for shape in shapes:
            shape.friction = 0.5
            self.add_to_space(shape)

        trans_joint = pm.PivotJoint(self.space.static_body, body, (0, 0),
                                    (0, 0))
        trans_joint.max_bias = 0
        trans_joint.max_force = self.phys_vars.shape_trans_joint_max_force
        self.add_to_space(trans_joint)
        rot_joint = pm.GearJoint(self.space.static_body, body, 0.0, 1.0)
        rot_joint.max_bias = 0
        rot_joint.max_force = self.phys_vars.shape_rot_joint_max_force
        self.add_to_space(rot_joint)

        # Drawing
        if self.shape_type == ShapeType.SQUARE:
            geoms_inner = [r.make_square(side_len - 2 * SHAPE_LINE_THICKNESS)]
            geoms_outer = [r.make_square(side_len)]
        elif self.shape_type == ShapeType.CIRCLE:
            geoms_inner = [
                r.make_circle(radius=self.shape_size - SHAPE_LINE_THICKNESS,
                              res=100),
            ]
            geoms_outer = [r.make_circle(radius=self.shape_size, res=100)]
        elif self.shape_type == ShapeType.STAR:
            star_short_verts = gtools.compute_star_verts(

                star_npoints, star_out_rad - SHAPE_LINE_THICKNESS,