Creating a custom menu of active grease pencil palette colors via Python Script (Blender 2.79b) So,I was looking to accelerate the coloring workflow in grease pencil by creating a custom menu of the active GP palette colors. The workflow would be to assign a hotkey to this custom menu and then invoke it while coloring.I have  scripted a Python code for this purpose andfacing the following issues-

1.Since GPcolors are array of RGB values(correct me if I am wrong) couldn’t find any pointer functions to point to array values.
 2.The code when run indicates an endless loop of menus.
Any suggestions would help.The code is given below-                               

import bpy
class GPcolorMenu(bpy.types.Menu):
    bl_label = "GPcolors"
    bl_idname = "gpencil.GPcolor_menu"

    def draw(self, context):
        layout = self.layout

        for color in bpy.data.grease_pencil["GPencil"].palettes["GP_Palette"].colors:


            layout.menu(GPcolorMenu.bl_idname, text=color.name)


def register():
    bpy.utils.register_module(__name__)    


def unregister():
    bpy.utils.unregister_module(__name__)  

if __name__ == "__main__":
    register()


bpy.ops.wm.call_menu(name=GPcolorMenu.bl_idname)
Here is the probable solution (but it gives an Anytype error)

import bpy
from bpy.types import Menu

class GPcolorsMenu(bpy.types.Menu):
    bl_label = "GPcolors"
    bl_idname = "gpencil.GPcolorSwitch"

    def draw(self, context):
        layout = self.layout

        #display active palette 
        palette = bpy.context.scene.grease_pencil.palettes.active
        row = layout.row(align=True)
        row.label(palette.name, icon_value=layout.icon(palette))

        col = layout.column(align=True)
        col.separator()

        #display GPcolor [keys()] for switching in a menu 

        key = bpy.context.scene.grease_pencil.palettes.active.colors.keys()
        for i in key:
            row = layout.row(align=True)
            row.prop(i,'name',text='')


def register():
    bpy.utils.register_class(GPcolorsMenu)


def unregister():
    bpy.utils.unregister_class(GPcolorsMenu)

if __name__ == "__main__":
    register()


    bpy.ops.wm.call_menu(name=GPcolorsMenu.bl_idname)