# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

""" Palette Loader """


def apply_default_colors(cls):
    color_map = {'orange': '#d51',
                 'light_orange': '#d31',
                 'white': 'white',
                 'black': 'black',
                 'light_aubergine': '#719',
                 'mid_aubergine': '#525',
                 'dark_aubergine': '#201',
                 'warm_grey': '#aaa',
                 'cool_grey': '#333',
                 'text_grey': '#333'}
    for k, v in color_map.items():
        setattr(cls, k, v)
    return cls


@apply_default_colors
class Palette:
    pass

STYLES = [('frame_header', Palette.white, Palette.black,
           'default', Palette.white, Palette.orange),
          ('frame_footer', Palette.white, Palette.black,
           'default', Palette.white, Palette.orange),
          ('body', Palette.white, 'default', 'default',
           Palette.white, Palette.black),
          ('button_primary', Palette.white, 'default',
           'default', Palette.white, Palette.cool_grey),
          ('button_primary focus', Palette.white,
           'default', 'default', Palette.white,
           Palette.light_orange),
          ('button_secondary', Palette.white, 'default',
           'default', Palette.white, Palette.cool_grey),
          ('button_secondary focus', Palette.white,
           'default', 'default', Palette.white, Palette.light_orange)]

STYLES_MONO = [('frame_header', Palette.white, Palette.black,
                'default', Palette.white, Palette.black),
               ('frame_footer', Palette.white, Palette.black,
                'default', Palette.white, Palette.black),
               ('body', 'default', 'default'),
               ('button_primary', 'default', 'default'),
               ('button_primary focus', 'default', 'default'),
               ('button_secondary', 'default', 'default'),
               ('button_secondary focus', 'default', 'default')]

@@ -1085,19 +1085,19 @@
 rey': '#
-333
+666
 ',%0A     
@@ -1261,24 +1261,29 @@
 %0A%0ASTYLES = %5B
+%0A    
 ('frame_head
@@ -1291,59 +1291,24 @@
 r', 
-Palette.white, Palette.black,%0A           'default',
+'', '', '',%0A    
  Pal
@@ -1332,30 +1332,24 @@
 te.orange),%0A
-      
     ('frame_
@@ -1361,59 +1361,24 @@
 r', 
-Palette.white, Palette.black,%0A           'default',
+'', '', '',%0A    
  Pal
@@ -1402,30 +1402,24 @@
 te.orange),%0A
-      
     ('body',
@@ -1423,51 +1423,20 @@
 y', 
-Palette.white, 'default', 'default',%0A      
+'', '', '',%0A
     
@@ -1467,30 +1467,24 @@
 black),%0A    
-   
-   
 ('button_pri
@@ -1494,53 +1494,22 @@
 y', 
-Palette.white, 'default',%0A           'default
+'', '',%0A     '
 ', P
@@ -1534,38 +1534,32 @@
 tte.cool_grey),%0A
-      
     ('button_pri
@@ -1575,55 +1575,24 @@
 s', 
-Palette.white,%0A           'default', 'default',
+'', '', '',%0A    
  Pal
@@ -1602,27 +1602,16 @@
 e.white,
-%0A          
  Palette
@@ -1626,22 +1626,16 @@
 range),%0A
-      
     ('bu
@@ -1655,55 +1655,24 @@
 y', 
-Palette.white, 'default',%0A           'default',
+'', '', '',%0A    
  Pal
@@ -1703,22 +1703,16 @@
 _grey),%0A
-      
     ('bu
@@ -1738,92 +1738,133 @@
 s', 
-Palette.white,%0A           'default', 'default', Palette.white, Palette.light_orange)
+'', '', '',%0A     Palette.white, Palette.light_orange),%0A    ('info_minor', '', '', '',%0A     Palette.text_grey, Palette.black)%0A
 %5D%0A%0AS
@@ -1945,46 +1945,17 @@
    '
-default', Palette.white, Palette.black
+', '', ''
 ),%0A 
@@ -2036,336 +2036,576 @@
    '
-default', Palette.white, Palette.black),%0A               ('body', 'default', 'default'),%0A               ('button_primary', 'default', 'default'),%0A               ('button_primary focus', 'default', 'default'),%0A               ('button_secondary', 'default', 'default'),%0A               ('button_secondary focus', 'default', 'default
+', '', ''),%0A               ('body', Palette.white, Palette.black,%0A                '', '', ''),%0A               ('info_minor', Palette.white, Palette.black,%0A                '', '', ''),%0A               ('button_primary', Palette.white, Palette.black,%0A                '', '', ''),%0A               ('button_primary focus', Palette.white, Palette.black,%0A                '', '', ''),%0A               ('button_secondary', Palette.white, Palette.black,%0A                '', '', ''),%0A               ('button_secondary focus', Palette.white, Palette.black,%0A                '', '', '
 ')%5D%0A

Update palette high colors