"""
Drawing canvas using Pillow
"""
from PIL import Image
from color import Color

class Canvas(object):
    def __init__(self, width, height):
        self.width = width
        self.height = height
        self.image = Image.new('RGB', (self.width, self.height))
        self.pixels = self.image.load()

    def write_pixel(self, x, y, c):
        self.pixels[x, y] = c.rgb()

    def pixel_at(self, x, y):
        return self.pixels[x, y]

    def show(self):
        self.image.show()



07e296a7f445865411393ee3d20ed6cf78dfa4f7
<mask token>


class Canvas(object):
    <mask token>
    <mask token>
    <mask token>
    <mask token>

<mask token>


class Canvas(object):

    def __init__(self, width, height):
        self.width = width
        self.height = height
        self.image = Image.new('RGB', (self.width, self.height))
        self.pixels = self.image.load()
    <mask token>

    def pixel_at(self, x, y):
        return self.pixels[x, y]
    <mask token>

<mask token>


class Canvas(object):

    def __init__(self, width, height):
        self.width = width
        self.height = height
        self.image = Image.new('RGB', (self.width, self.height))
        self.pixels = self.image.load()
    <mask token>

    def pixel_at(self, x, y):
        return self.pixels[x, y]

    def show(self):
        self.image.show()

<mask token>


class Canvas(object):

    def __init__(self, width, height):
        self.width = width
        self.height = height
        self.image = Image.new('RGB', (self.width, self.height))
        self.pixels = self.image.load()

    def write_pixel(self, x, y, c):
        self.pixels[x, y] = c.rgb()

    def pixel_at(self, x, y):
        return self.pixels[x, y]

    def show(self):
        self.image.show()

"""
Drawing canvas using Pillow
"""
from PIL import Image
from color import Color

class Canvas(object):
    def __init__(self, width, height):
        self.width = width
        self.height = height
        self.image = Image.new('RGB', (self.width, self.height))
        self.pixels = self.image.load()

    def write_pixel(self, x, y, c):
        self.pixels[x, y] = c.rgb()

    def pixel_at(self, x, y):
        return self.pixels[x, y]

    def show(self):
        self.image.show()


