# Path: spriteworld/sprite.py
# FACTOR_NAMES = (
#     'x',  # x-position of sprite center-of-mass (float)
#     'y',  # y-position of sprite center-of-mass (float)
#     'shape',  # shape (string)
#     'angle',  # angle in degrees (scalar)
#     'scale',  # size of sprite (float)
#     'c0',  # first color component (scalar)
#     'c1',  # second color component (scalar)
#     'c2',  # third color component (scalar)
#     'x_vel',  # x-component of velocity (float)
#     'y_vel',  # y-component of velocity (float)
# )
# _MAX_TRIES = int(1e6)
# class Sprite(object):
#   def __init__(self,
#                x=0.5,
#                y=0.5,
#                shape='square',
#                angle=0,
#                scale=0.1,
#                c0=0,
#                c1=0,
#                c2=0,
#                x_vel=0.0,
#                y_vel=0.0):
#   def _reset_centered_path(self):
#   def move(self, motion, keep_in_frame=False):
#   def update_position(self, keep_in_frame=False):
#   def contains_point(self, point):
#   def sample_contained_position(self):
#   def vertices(self):
#   def out_of_frame(self):
#   def x(self):
#   def y(self):
#   def shape(self):
#   def shape(self, s):
#   def angle(self):
#   def angle(self, a):
#   def scale(self):
#   def scale(self, s):
#   def c0(self):
#   def c1(self):
#   def c2(self):
#   def x_vel(self):
#   def y_vel(self):
#   def color(self):
#   def position(self):
#   def velocity(self):
#   def factors(self):
# 
# Path: spriteworld/renderers/pil_renderer.py
# class PILRenderer(abstract_renderer.AbstractRenderer):
#   def __init__(self,
#                image_size=(64, 64),
#                anti_aliasing=1,
#                bg_color=None,
#                color_to_rgb=None):
#   def render(self, sprites=(), global_state=None):
#   def observation_spec(self):


import colorsys
import numpy as np
from absl.testing import absltest
from spriteworld import sprite
from spriteworld.renderers import pil_renderer
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
# python2 python3
"""Tests for pil_renderer."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function



class PilRendererTest(absltest.TestCase):

  def _get_sprites(self):
    """Get list of sprites."""
    sprites = [
        sprite.Sprite(
            x=0.75, y=0.95, shape='spoke_6', scale=0.2, c0=20, c1=50, c2=80),
        sprite.Sprite(
            x=0.2, y=0.3, shape='triangle', scale=0.1, c0=150, c1=255, c2=100),

# Path: spriteworld/sprite.py
# FACTOR_NAMES = (
#     'x',  # x-position of sprite center-of-mass (float)
#     'y',  # y-position of sprite center-of-mass (float)
#     'shape',  # shape (string)
#     'angle',  # angle in degrees (scalar)
#     'scale',  # size of sprite (float)
#     'c0',  # first color component (scalar)
#     'c1',  # second color component (scalar)
#     'c2',  # third color component (scalar)
#     'x_vel',  # x-component of velocity (float)
#     'y_vel',  # y-component of velocity (float)
# )
# _MAX_TRIES = int(1e6)
# class Sprite(object):
#   def __init__(self,
#                x=0.5,
#                y=0.5,
#                shape='square',
#                angle=0,
#                scale=0.1,
#                c0=0,
#                c1=0,
#                c2=0,
#                x_vel=0.0,
#                y_vel=0.0):
#   def _reset_centered_path(self):
#   def move(self, motion, keep_in_frame=False):
#   def update_position(self, keep_in_frame=False):
#   def contains_point(self, point):
#   def sample_contained_position(self):
#   def vertices(self):
#   def out_of_frame(self):
#   def x(self):
#   def y(self):
#   def shape(self):
#   def shape(self, s):
#   def angle(self):
#   def angle(self, a):
#   def scale(self):
#   def scale(self, s):
#   def c0(self):
#   def c1(self):
#   def c2(self):
#   def x_vel(self):
#   def y_vel(self):
#   def color(self):
#   def position(self):
#   def velocity(self):
#   def factors(self):
# 
# Path: spriteworld/renderers/pil_renderer.py
# class PILRenderer(abstract_renderer.AbstractRenderer):
#   def __init__(self,
#                image_size=(64, 64),
#                anti_aliasing=1,
#                bg_color=None,
#                color_to_rgb=None):
#   def render(self, sprites=(), global_state=None):
#   def observation_spec(self):


# Path: tests/renderers/pil_renderer_test.py
import colorsys
import numpy as np
from absl.testing import absltest
from spriteworld import sprite
from spriteworld.renderers import pil_renderer

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
# python2 python3
"""Tests for pil_renderer."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function



class PilRendererTest(absltest.TestCase):

  def _get_sprites(self):
    """Get list of sprites."""
    sprites = [
        sprite.Sprite(
            x=0.75, y=0.95, shape='spoke_6', scale=0.2, c0=20, c1=50, c2=80),
        sprite.Sprite(
            x=0.2, y=0.3, shape='triangle', scale=0.1, c0=150, c1=255, c2=100),

        sprite.Sprite(