Monkey: drawing a mosaic

Import mojo
Global sprite:MyApp

Function Main()
    sprite = New MyApp()
End Function

Class TColor
    Field r:Int,g:Int,b:Int
    Method Color()
        SetColor r,g,b
    End Method

    Method Set(rgb$)
    End Method
End Class

Class MyApp Extends App
    Field pixel:Int[256]
    Field palette:TColor[16]

    Method OnCreate()
        SetUpdateRate 50

        For Local col:Int=0 To 15
            palette[col]=New TColor
            palette[col].Set "000333555777300520742764003025247467020040160370"[col*3..col*3+3]

        For Local t:Int=0 To 255
    End Method

    Method OnRender()
        Local i:Int
        For Local y:Int=0 To 15
            For Local x:Int=0 To 15
                DrawRect x*16,y*16,16,16
    End Method

    Method OnUpdate()
    End Method
End Class