# -*- Mode:Python; explicit-buffer-name: "display.conf<common>" -*-

import helpers

if helpers.techno == 'symbolic/vsc200':
    poly2Color = 'Magenta4'
else:
    poly2Color = 'Orange'


defaultStyle = 'Alliance.Classic [black]'

stylesTable = \
    ( ( (Style    , 'Alliance.Coriolis [black]', 'Alliance Coriolis Look - black background')
      , (Darkening, 1.0, 3.0, 2.5)
  
      # Group: Viewer.
      , (Group  , 'Viewer')
      , (Drawing, 'fallback'       , { 'color':'Gray238'    , 'border':1, 'pattern':'55AA55AA55AA55AA' })
      , (Drawing, 'background'     , { 'color':'Gray50'     , 'border':1 })
      , (Drawing, 'foreground'     , { 'color':'White'      , 'border':1 })
      , (Drawing, 'rubber'         , { 'color':'192,0,192'  , 'border':2, 'threshold':0.02*scale })
      , (Drawing, 'phantom'        , { 'color':'Seashell4'  , 'border':1 })
      , (Drawing, 'boundaries'     , { 'color':'208,199,192', 'border':1, 'pattern':'0000000000000000', 'threshold':0 })
      , (Drawing, 'marker'         , { 'color':'80,250,80'  , 'border':1 })
      , (Drawing, 'selectionDraw'  , { 'color':'White'      , 'border':1 })
      , (Drawing, 'selectionFill'  , { 'color':'White'      , 'border':1 })
      , (Drawing, 'grid'           , { 'color':'White'      , 'border':1, 'threshold':2.0*scale })
      , (Drawing, 'spot'           , { 'color':'White'      , 'border':2, 'threshold':6.0*scale })
      , (Drawing, 'ghost'          , { 'color':'White'      , 'border':1 })
      , (Drawing, 'text.ruler'     , { 'color':'White'      , 'border':1, 'threshold':0.0*scale })
      , (Drawing, 'text.instance'  , { 'color':'Black'      , 'border':1, 'threshold':4.0*scale })
      , (Drawing, 'text.reference' , { 'color':'White'      , 'border':1, 'threshold':20.0*scale })
      , (Drawing, 'undef'          , { 'color':'Violet'     , 'border':0, 'pattern':'2244118822441188' })
      , (Drawing, 'mauka.container', { 'color':'Magenta4'   , 'border':4, 'pattern':'0000000000000000', 'goMatched':False })
  
      # Group: Active Layer.
      , (Group  , 'Active Layer')
      , (Drawing, 'nWell'   , { 'color':'Tan'        , 'pattern':'55AA55AA55AA55AA', 'threshold':1.5 *scale })
      , (Drawing, 'pWell'   , { 'color':'LightYellow', 'pattern':'55AA55AA55AA55AA', 'threshold':1.50*scale })
      , (Drawing, 'nImplant', { 'color':'LawnGreen'  , 'pattern':'55AA55AA55AA55AA', 'threshold':1.50*scale })
      , (Drawing, 'pImplant', { 'color':'Yellow'     , 'pattern':'55AA55AA55AA55AA', 'threshold':1.50*scale })
      , (Drawing, 'active'  , { 'color':'White'      , 'pattern':'antihash1.8'     , 'threshold':1.50*scale })
      , (Drawing, 'poly'    , { 'color':'Red'        , 'pattern':'55AA55AA55AA55AA', 'threshold':1.50*scale })
  
      # Group: Routing Layer.
      , (Group  , 'Routing Layer')
      , (Drawing, 'metal1' , { 'color':'Blue'     , 'pattern':'poids2.8'          , 'threshold':0.80*scale })
      , (Drawing, 'metal2' , { 'color':'Aqua'     , 'pattern':'light_antihash0.8' , 'threshold':0.02*scale })
      , (Drawing, 'metal3' , { 'color':'LightPink', 'pattern':'light_antihash1.8' , 'threshold':0.02*scale })
      , (Drawing, 'metal4' , { 'color':'Green'    , 'pattern':'light_antihash2.8' , 'threshold':0.02*scale })
      , (Drawing, 'metal5' , { 'color':'Yellow'   , 'pattern':'1144114411441144'  , 'threshold':0.02*scale })
      , (Drawing, 'metal6' , { 'color':'Violet'   , 'pattern':'light_antihash0.8' , 'threshold':0.02*scale })
      , (Drawing, 'metal7' , { 'color':'Violet'   , 'pattern':'light_antihash0.8' , 'threshold':0.02*scale })
      , (Drawing, 'metal8' , { 'color':'Violet'   , 'pattern':'light_antihash0.8' , 'threshold':0.02*scale })
      , (Drawing, 'metal9' , { 'color':'Violet'   , 'pattern':'light_antihash0.8' , 'threshold':0.02*scale })
      , (Drawing, 'metal10', { 'color':'Violet'   , 'pattern':'light_antihash0.8' , 'threshold':0.02*scale })
  
      # Group: Cuts (VIA holes).
      , (Group  , 'Cuts (VIA Holes)')
      , (Drawing, 'cut0', { 'color':'0,150,150', 'threshold':1.50*scale })
      , (Drawing, 'cut1', { 'color':'Aqua'     , 'threshold':0.80*scale })
      , (Drawing, 'cut2', { 'color':'LightPink', 'threshold':0.80*scale })
      , (Drawing, 'cut3', { 'color':'Green'    , 'threshold':0.80*scale })
      , (Drawing, 'cut4', { 'color':'Yellow'   , 'threshold':0.80*scale })
      , (Drawing, 'cut5', { 'color':'Violet'   , 'threshold':0.80*scale })
      , (Drawing, 'cut6', { 'color':'Violet'   , 'threshold':0.80*scale })
      , (Drawing, 'cut7', { 'color':'Violet'   , 'threshold':0.80*scale })
      , (Drawing, 'cut8', { 'color':'Violet'   , 'threshold':0.80*scale })
      , (Drawing, 'cut9', { 'color':'Violet'   , 'threshold':0.80*scale })
  
      # Group: MIM6.
      , (Group  , 'MIM6')
     #, (Drawing, 'topmim6' , { 'color':'Blue'     , 'pattern':'poids2.8'         , 'threshold':0.80*scale })
      , (Drawing, 'metbot_r', { 'color':'Aqua'     , 'pattern':'light_antihash0.8', 'threshold':0.80*scale })
      , (Drawing, 'cut6'    , { 'color':'LightPink', 'pattern':'light_antihash1.8', 'threshold':0.80*scale })
      , (Drawing, 'metal7'  , { 'color':'Green'    , 'pattern':'light_antihash2.8', 'threshold':0.80*scale })
  
      # Group: Blockages.
      , (Group  , 'Blockages')
      , (Drawing, 'blockage1' , { 'color':'Blue'     , 'pattern':'006070381c0e0703' , 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'blockage2' , { 'color':'Aqua'     , 'pattern':'8103060c183060c0' , 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'blockage3' , { 'color':'LightPink', 'pattern':'poids4.8'         , 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'blockage4' , { 'color':'Green'    , 'pattern':'light_antihash2.8', 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'blockage5' , { 'color':'Yellow'   , 'pattern':'1144114411441144' , 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'blockage6' , { 'color':'Violet'   , 'pattern':'light_antihash0.8', 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'blockage7' , { 'color':'Violet'   , 'pattern':'light_antihash0.8', 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'blockage8' , { 'color':'Violet'   , 'pattern':'light_antihash0.8', 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'blockage9' , { 'color':'Violet'   , 'pattern':'light_antihash0.8', 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'blockage10', { 'color':'Violet'   , 'pattern':'light_antihash0.8', 'threshold':0.80*scale, 'border':2 })
  
      # Group: Knik & Kite.
      , (Group  , 'Knik & Kite')
      , (Drawing, 'SPL1'     , { 'color':'Red'        })
      , (Drawing, 'AutoLayer', { 'color':'Magenta'    })
      , (Drawing, 'gmetalh'  , { 'color':'128,255,200', 'pattern':'light_antihash0.8', 'border':1 })
      , (Drawing, 'gmetalv'  , { 'color':'200,200,255', 'pattern':'light_antihash1.8', 'border':1 })
      , (Drawing, 'gcut'     , { 'color':'255,255,190', 'border':1 })
      , (Drawing, 'Anabatic::Edge' , { 'color':'255,255,190', 'pattern':'0000000000000000', 'threshold':0.02*scale, 'border':4 })
      , (Drawing, 'Anabatic::GCell', { 'color':'255,0,0'    , 'pattern':'0000000000000000', 'threshold':0.02*scale, 'border':4 })
      )

    # ----------------------------------------------------------------------
    # Style: Alliance.Coriolis [white].
    , ( (Style    , 'Alliance.Coriolis [white]', 'Alliance Coriolis Look - white background')
      , (Inherit  , 'Alliance.Coriolis [black]')
      , (Darkening, 1.0, 3.0, 2.5)
      
      , (Group  , 'Viewer')
      , (Drawing, 'fallback'     , { 'color':'Black', 'border':1, 'pattern':'55AA55AA55AA55AA' })
      , (Drawing, 'background'   , { 'color':'White', 'border':1 })
      , (Drawing, 'foreground'   , { 'color':'Black', 'border':1 })
      , (Drawing, 'selectionDraw', { 'color':'Black', 'border':1 })
      , (Drawing, 'selectionFill', { 'color':'Black', 'border':1 })
      , (Drawing, 'grid'         , { 'color':'Black', 'border':1, 'threshold':6.0*scale })
      , (Drawing, 'spot'         , { 'color':'Black', 'border':1, 'threshold':6.0*scale })
      , (Drawing, 'ghost'        , { 'color':'Black', 'border':1 })
      , (Drawing, 'text.ruler'   , { 'color':'Black', 'border':1, 'threshold':0.0*scale })
      , (Drawing, 'text.instance', { 'color':'Black', 'border':1, 'threshold':4.0*scale })
      , (Drawing, 'undef'        , { 'color':'Black', 'border':0, 'pattern':'2244118822441188' })
      )

    # ----------------------------------------------------------------------
    # Style: Alliance.Classic [black]
    , ( (Style, 'Alliance.Classic [black]', 'Alliance Classic Look - black background')
      , (Darkening, 1.0, 3.0, 2.5)
  
      # Viewer.
      , (Group  , 'Viewer')
      , (Drawing, 'fallback'      , { 'color':'Gray238'    , 'border':1, 'pattern':'55AA55AA55AA55AA' })
      , (Drawing, 'background'    , { 'color':'Gray50'     , 'border':1 })
      , (Drawing, 'foreground'    , { 'color':'White'      , 'border':1 })
      , (Drawing, 'rubber'        , { 'color':'192,0,192'  , 'border':4, 'threshold':0.02*scale })
      , (Drawing, 'phantom'       , { 'color':'Seashell4'  , 'border':1 })
      , (Drawing, 'boundaries'    , { 'color':'208,199,192', 'border':1, 'pattern':'0000000000000000', 'threshold':0 })
      , (Drawing, 'marker'        , { 'color':'80,250,80'  , 'border':1 })
      , (Drawing, 'selectionDraw' , { 'color':'White'      , 'border':1 })
      , (Drawing, 'selectionFill' , { 'color':'White'      , 'border':1 })
      , (Drawing, 'grid'          , { 'color':'White'      , 'border':1, 'threshold':2.0*scale })
      , (Drawing, 'spot'          , { 'color':'White'      , 'border':2, 'threshold':6.0*scale })
      , (Drawing, 'ghost'         , { 'color':'White'      , 'border':1 })
      , (Drawing, 'text.ruler'    , { 'color':'White'      , 'border':1, 'threshold':0.0 *scale })
      , (Drawing, 'text.instance' , { 'color':'White'      , 'border':1, 'threshold':400.0 *scale })
      , (Drawing, 'text.reference', { 'color':'White'      , 'border':1, 'threshold':200.0*scale })
      , (Drawing, 'undef'         , { 'color':'Violet'     , 'border':0, 'pattern':'2244118822441188' })
  
      # Active Layers.
      , (Group  , 'Active Layers')
      , (Drawing, 'nWell'   , { 'color':'Tan'        , 'pattern':'urgo.8'         , 'border':1, 'threshold':0*scale })
      , (Drawing, 'pWell'   , { 'color':'LightYellow', 'pattern':'urgo.8'         , 'border':1, 'threshold':0*scale })
      , (Drawing, 'nImplant', { 'color':'LawnGreen'  , 'pattern':'antihash0.8'    , 'border':1, 'threshold':0*scale })
      , (Drawing, 'pImplant', { 'color':'Yellow'     , 'pattern':'antihash0.8'    , 'border':1, 'threshold':0*scale })
      , (Drawing, 'active'  , { 'color':'White'      , 'pattern':'antihash1.8'    , 'border':1, 'threshold':0*scale })
      , (Drawing, 'poly'    , { 'color':'Red'        , 'pattern':'poids2.8'       , 'border':1, 'threshold':0*scale })
      , (Drawing, 'poly2'   , { 'color':poly2Color   , 'pattern':'poids2.8'       , 'border':1, 'threshold':0*scale })
  
      # Routing Layers.
      , (Group  , 'Routing Layers')
     #, (Drawing, 'metal1' , { 'color':'Blue'         , 'pattern':'light_antislash0.8', 'border':1, 'threshold':0.80*scale })
      , (Drawing, 'metal1' , { 'color':'Blue'         , 'pattern':'slash.8'           , 'border':1, 'threshold':00*scale })
      , (Drawing, 'metal2' , { 'color':'Aqua'         , 'pattern':'poids4.8'          , 'border':1, 'threshold':0.0*scale })
      , (Drawing, 'metcap' , { 'color':'DarkTurquoise', 'pattern':'poids2.8'          , 'border':2, 'threshold':0.0*scale })
      , (Drawing, 'metal3' , { 'color':'LightPink'    , 'pattern':'poids4.8'          , 'border':1, 'threshold':0.0*scale })
      , (Drawing, 'metal4' , { 'color':'Green'        , 'pattern':'poids4.8'          , 'border':1, 'threshold':0.0*scale })
      , (Drawing, 'metal5' , { 'color':'Yellow'       , 'pattern':'poids4.8'          , 'border':1, 'threshold':0.0*scale })
      , (Drawing, 'metal6' , { 'color':'Violet'       , 'pattern':'poids4.8'          , 'border':1, 'threshold':0.0*scale })
      , (Drawing, 'metal7' , { 'color':'Red'          , 'pattern':'poids4.8'          , 'border':1, 'threshold':0.0*scale })
      , (Drawing, 'metal8' , { 'color':'Blue'         , 'pattern':'poids4.8'          , 'border':1, 'threshold':0.0*scale })
      , (Drawing, 'metal9' , { 'color':'Blue'         , 'pattern':'poids4.8'          , 'border':1, 'threshold':0.0*scale })
      , (Drawing, 'metal10', { 'color':'Blue'         , 'pattern':'poids4.8'          , 'border':1, 'threshold':0.0*scale })
  
      # Cuts (VIA holes).
      , (Group  , 'Cuts (VIA holes)')
      , (Drawing, 'cut0', { 'color':'0,150,150', 'threshold':0*scale })
      , (Drawing, 'cut1', { 'color':'Aqua'     , 'threshold':0.0*scale })
      , (Drawing, 'cut2', { 'color':'LightPink', 'threshold':0.0*scale })
      , (Drawing, 'cut3', { 'color':'Green'    , 'threshold':0.0*scale })
      , (Drawing, 'cut4', { 'color':'Yellow'   , 'threshold':0.0*scale })
      , (Drawing, 'cut5', { 'color':'Violet'   , 'threshold':0.0*scale })
      , (Drawing, 'cut6', { 'color':'Red'      , 'threshold':0.0*scale })
      , (Drawing, 'cut7', { 'color':'Blue'     , 'threshold':0.0*scale })
      , (Drawing, 'cut8', { 'color':'Blue'     , 'threshold':0.0*scale })
      , (Drawing, 'cut9', { 'color':'Blue'     , 'threshold':0.0*scale })
  
      # MIM6.
      , (Group  , 'MIM6')
     #, (Drawing, 'topmim6' , { 'color':'Blue'     , 'pattern':'poids2.32'         , 'threshold':0.80*scale })
      , (Drawing, 'metbot_r', { 'color':'Aqua'     , 'pattern':'light_antihash0.8' , 'threshold':0.80*scale })
     #, (Drawing, 'padopen' , { 'color':'LightPink', 'pattern':'light_antihash1.8' , 'threshold':0.80*scale })
      , (Drawing, 'metal7'  , { 'color':'Green'    , 'pattern':'light_antihash2.8' , 'threshold':0.80*scale })
  
      # Blockages.
      , (Group  , 'Blockages')
      , (Drawing, 'blockage1' , { 'color':'Blue'     , 'pattern':'light_antislash0.8', 'threshold':0.80*scale, 'border':4 })
      , (Drawing, 'blockage2' , { 'color':'Aqua'     , 'pattern':'poids4.8'          , 'threshold':0.80*scale, 'border':4 })
      , (Drawing, 'blockage3' , { 'color':'LightPink', 'pattern':'poids4.8'          , 'threshold':0.80*scale, 'border':4 })
      , (Drawing, 'blockage4' , { 'color':'Green'    , 'pattern':'poids4.8'          , 'threshold':0.80*scale, 'border':4 })
      , (Drawing, 'blockage5' , { 'color':'Yellow'   , 'pattern':'poids4.8'          , 'threshold':0.80*scale, 'border':4 })
      , (Drawing, 'blockage6' , { 'color':'Violet'   , 'pattern':'poids4.8'          , 'threshold':0.80*scale, 'border':4 })
      , (Drawing, 'blockage7' , { 'color':'Red'      , 'pattern':'poids4.8'          , 'threshold':0.80*scale, 'border':4 })
      , (Drawing, 'blockage8' , { 'color':'Blue'     , 'pattern':'poids4.8'          , 'threshold':0.80*scale, 'border':4 })
      , (Drawing, 'blockage9' , { 'color':'Blue'     , 'pattern':'poids4.8'          , 'threshold':0.80*scale, 'border':4 })
      , (Drawing, 'blockage10', { 'color':'Blue'     , 'pattern':'poids4.8'          , 'threshold':0.80*scale, 'border':4 })
  
      # Knick & Kite.
      , (Group  , 'Knick & Kite')
      , (Drawing, 'SPL1'     , { 'color':'Red'        })
      , (Drawing, 'AutoLayer', { 'color':'Magenta'    })
      , (Drawing, 'gmetalh'  , { 'color':'128,255,200', 'pattern':'antislash2.32'    , 'border':1 })
      , (Drawing, 'gmetalv'  , { 'color':'200,200,255', 'pattern':'light_antihash1.8', 'border':1 })
      , (Drawing, 'gcut'     , { 'color':'255,255,190', 'border':1 })
      , (Drawing, 'Anabatic::Edge' , { 'color':'255,255,190', 'pattern':'0000000000000000', 'border':4, 'threshold':0.02*scale })
      , (Drawing, 'Anabatic::GCell', { 'color':'255,255,190', 'pattern':'0000000000000000', 'border':2, 'threshold':0.10*scale })
      )

    # ----------------------------------------------------------------------
    # Style: Alliance.Classic [white]
    , ( (Style, 'Alliance.Classic [white]', 'Alliance Classic Look - white background')
      , (Inherit  , 'Alliance.Classic [black]')
      , (Darkening, 1.0, 3.0, 2.5)

      # Group: Viewer.
      , (Group  , 'Viewer')
      , (Drawing, 'fallback'      , { 'color':'Black', 'border':1, 'pattern':'55AA55AA55AA55AA' })
      , (Drawing, 'background'    , { 'color':'White', 'border':1 })
      , (Drawing, 'foreground'    , { 'color':'Black', 'border':1 })
      , (Drawing, 'selectionDraw' , { 'color':'Black', 'border':1 })
      , (Drawing, 'selectionFill' , { 'color':'Black', 'border':1 })
      , (Drawing, 'grid'          , { 'color':'Black', 'border':1, 'threshold':6.0*scale })
      , (Drawing, 'spot'          , { 'color':'Black', 'border':1, 'threshold':6.0*scale })
      , (Drawing, 'ghost'         , { 'color':'Black', 'border':1 })
      , (Drawing, 'text.ruler'    , { 'color':'Black', 'border':1, 'threshold':0.0 *scale })
      , (Drawing, 'text.instance' , { 'color':'Black', 'border':1, 'threshold':4.0 *scale })
      , (Drawing, 'text.reference', { 'color':'Black', 'border':1, 'threshold':20.0*scale })
      , (Drawing, 'undef'         , { 'color':'Black', 'border':0, 'pattern':'2244118822441188' })
      )

    # ----------------------------------------------------------------------
    # Style: Ispd Global Route [black]
    , ( (Style, 'Ispd Global Route', 'ISPD Global Route Look - black background')
      , (Inherit  , 'Alliance.Classic [black]')
      , (Darkening, 1.0, 3.0, 2.5)

      # Group: Viewer.
      , (Group  , 'Viewer')
      , (Drawing, 'background', { 'color':'Black'    , 'border':1 })
      , (Drawing, 'rubber'    , { 'color':'192,0,192', 'border':1, 'threshold':0 })

      # Group: Knik & Kite.
      , (Group  , 'Knik & Kite')
      , (Drawing, 'gmetalh' , { 'color':'128,255,200', 'pattern':'light_antihash0.8' , 'border':1, 'threshold':0 })
      , (Drawing, 'gmetalv' , { 'color':'200,200,255', 'pattern':'light_antihash1.8' , 'border':1, 'threshold':0 })
      , (Drawing, 'gcontact', { 'color':'255,255,190', 'border':1, 'threshold':0 })
      )

    # ----------------------------------------------------------------------
    # Style: Layout Design [black].
    , ( (Style, 'Layout Design', 'Useful for debugging layout - black background')
      , (Inherit  , 'Alliance.Classic [black]')
      , (Darkening, 1.0, 3.0, 2.5)

      # Active Layers.
      , (Group  , 'Active Layers')
      , (Drawing, 'nWell'   , { 'color':'Tan'        , 'pattern':'0000000000000000', 'threshold':1.50*scale, 'border':2 })
      , (Drawing, 'pWell'   , { 'color':'LightYellow', 'pattern':'0000000000000000', 'threshold':1.50*scale, 'border':2 })
      , (Drawing, 'nImplant', { 'color':'LawnGreen'  , 'pattern':'0000000000000000', 'threshold':1.50*scale, 'border':2 })
      , (Drawing, 'pImplant', { 'color':'Yellow'     , 'pattern':'0000000000000000', 'threshold':1.50*scale, 'border':2 })
      , (Drawing, 'active'  , { 'color':'White'      , 'pattern':'0000000000000000', 'threshold':1.50*scale, 'border':2 })
      , (Drawing, 'poly'    , { 'color':'Red'        , 'pattern':'0000000000000000', 'threshold':1.50*scale, 'border':2 })

      # Routing Layers.
      , (Group  , 'Routing Layers')
      , (Drawing, 'metal1'  , { 'color':'Blue'     , 'pattern':'0000000000000000', 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'metal2'  , { 'color':'Aqua'     , 'pattern':'0000000000000000', 'threshold':0.40*scale, 'border':2 })
      , (Drawing, 'metal3'  , { 'color':'LightPink', 'pattern':'0000000000000000', 'threshold':0.02*scale, 'border':2 })
      , (Drawing, 'metal4'  , { 'color':'Green'    , 'pattern':'0000000000000000', 'threshold':0.02*scale, 'border':2 })
      , (Drawing, 'metal5'  , { 'color':'Yellow'   , 'pattern':'0000000000000000', 'threshold':0.02*scale, 'border':2 })
      , (Drawing, 'metal6'  , { 'color':'Violet'   , 'pattern':'0000000000000000', 'threshold':0.02*scale, 'border':2 })
      , (Drawing, 'metal7'  , { 'color':'Violet'   , 'pattern':'0000000000000000', 'threshold':0.02*scale, 'border':2 })
      , (Drawing, 'metal8'  , { 'color':'Violet'   , 'pattern':'0000000000000000', 'threshold':0.02*scale, 'border':2 })
      , (Drawing, 'metal9'  , { 'color':'Violet'   , 'pattern':'0000000000000000', 'threshold':0.02*scale, 'border':2 })
      , (Drawing, 'metal10' , { 'color':'Violet'   , 'pattern':'0000000000000000', 'threshold':0.02*scale, 'border':2 })

      # Cuts (VIA holes).
      , (Group  , 'Cuts (VIA holes)')
      , (Drawing, 'cut0'    , { 'color':'0,150,150', 'pattern':'poids4.8'        , 'threshold':1.50*scale, 'border':1 })
      , (Drawing, 'cut1'    , { 'color':'Aqua'     , 'pattern':'0000000000000000', 'threshold':0.80*scale, 'border':1 })
      , (Drawing, 'cut2'    , { 'color':'LightPink', 'pattern':'0000000000000000', 'threshold':0.80*scale, 'border':1 })
      , (Drawing, 'cut3'    , { 'color':'Green'    , 'pattern':'0000000000000000', 'threshold':0.80*scale, 'border':1 })
      , (Drawing, 'cut4'    , { 'color':'Yellow'   , 'pattern':'0000000000000000', 'threshold':0.80*scale, 'border':1 })
      , (Drawing, 'cut5'    , { 'color':'Violet'   , 'pattern':'0000000000000000', 'threshold':0.80*scale, 'border':1 })
      , (Drawing, 'cut6'    , { 'color':'Violet'   , 'pattern':'0000000000000000', 'threshold':0.80*scale, 'border':1 })
      , (Drawing, 'cut7'    , { 'color':'Violet'   , 'pattern':'0000000000000000', 'threshold':0.80*scale, 'border':1 })
      , (Drawing, 'cut8'    , { 'color':'Violet'   , 'pattern':'0000000000000000', 'threshold':0.80*scale, 'border':1 })
      , (Drawing, 'cut9'    , { 'color':'Violet'   , 'pattern':'0000000000000000', 'threshold':0.80*scale, 'border':1 })
      )

    # ----------------------------------------------------------------------
    # Style: Layout Design [white].
    , ( (Style, 'Layout Design White', 'Useful for debugging layout - white background')
      , (Inherit  , 'Layout Design')
      , (Darkening, 1.0, 3.0, 2.5)

      # Group: Viewer.
      , (Group  , 'Viewer')
      , (Drawing, 'background'    , { 'color':'White', 'border':1 })
      , (Drawing, 'grid'          , { 'color':'Black', 'border':1, 'threshold':2.0 *scale })
      , (Drawing, 'spot'          , { 'color':'Black', 'border':1, 'threshold':2.0 *scale })
      , (Drawing, 'text.ruler'    , { 'color':'Black', 'border':1, 'threshold':0.0 *scale })
      , (Drawing, 'text.reference', { 'color':'Black', 'border':1, 'threshold':20.0*scale })

      # Group: Active Layers.
      , (Group  , 'Active Layers')
      , (Drawing, 'active', { 'color':'175,175,175', 'pattern':'0000000000000000', 'threshold':1.50*scale, 'border':2 })
      )

    # ----------------------------------------------------------------------
    # Style: Look for Printers [white].
    , ( (Style, 'Printer.Coriolis', 'Coriolis Look for Printers')
      , (Darkening, 1.0, 3.0, 2.5)

      # Group: Viewer.
      , (Group  , 'Viewer')
      , (Drawing, 'fallback'       , { 'color':'Gray238'  , 'border':1, 'pattern':'55AA55AA55AA55AA' })
      , (Drawing, 'background'     , { 'color':'White'    , 'border':1 })
      , (Drawing, 'foreground'     , { 'color':'Black'    , 'border':1 })
      , (Drawing, 'rubber'         , { 'color':'192,0,192', 'border':4, 'threshold':0.02*scale })
      , (Drawing, 'phantom'        , { 'color':'Seashell4', 'border':1 })
      , (Drawing, 'boundaries'     , { 'color':'Black'    , 'border':1, 'pattern':'0000000000000000', 'threshold':0 })
      , (Drawing, 'marker'         , { 'color':'80,250,80', 'border':1 })
      , (Drawing, 'selectionDraw'  , { 'color':'Black'    , 'border':1 })
      , (Drawing, 'selectionFill'  , { 'color':'Black'    , 'border':1 })
      , (Drawing, 'grid'           , { 'color':'Black'    , 'border':1, 'threshold':2.0*scale })
      , (Drawing, 'spot'           , { 'color':'Black'    , 'border':2, 'threshold':6.0*scale })
      , (Drawing, 'ghost'          , { 'color':'Black'    , 'border':1 })
      , (Drawing, 'text.ruler'     , { 'color':'Black'    , 'border':1, 'threshold':0.0 *scale })
      , (Drawing, 'text.instance'  , { 'color':'Black'    , 'border':1, 'threshold':4.0 *scale })
      , (Drawing, 'text.reference' , { 'color':'Black'    , 'border':1, 'threshold':20.0*scale })
      , (Drawing, 'undef'          , { 'color':'Violet'   , 'border':0, 'pattern':'2244118822441188' })
      , (Drawing, 'mauka.container', { 'color':'Magenta4' , 'border':4, 'pattern':'0000000000000000', 'goMatched':False })

      # Group: Active Layers.
      , (Group  , 'Active Layers')
      , (Drawing, 'nWell'   , { 'color':'Tan'        , 'pattern':'antipoids2.32', 'border':1, 'threshold':0.02*scale })
      , (Drawing, 'pWell'   , { 'color':'LightYellow', 'pattern':'antipoids2.32', 'border':1, 'threshold':0.02*scale })
      , (Drawing, 'nImplant', { 'color':'LawnGreen'  , 'pattern':'diffusion.32' , 'border':0, 'threshold':0.02*scale })
      , (Drawing, 'pImplant', { 'color':'Yellow'     , 'pattern':'diffusion.32' , 'border':0, 'threshold':0.02*scale })
      , (Drawing, 'active'  , { 'color':'White'      , 'pattern':'active.32'    , 'border':0, 'threshold':0.02*scale })
      , (Drawing, 'poly'    , { 'color':'Red'        , 'pattern':'antipoids2.32', 'border':1, 'threshold':0.02*scale })
      , (Drawing, 'poly2'   , { 'color':poly2Color   , 'pattern':'antipoids2.32', 'border':1, 'threshold':0.02*scale })

      # Group: Routing Layers.
      , (Group  , 'Routing Layers')
      , (Drawing, 'metal1' , { 'color':'Blue'         , 'pattern':'slash.32'     , 'border':1, 'threshold':0.02*scale })
      , (Drawing, 'metal2' , { 'color':'Aqua'         , 'pattern':'antislash2.32', 'border':1, 'threshold':0.02*scale })
      , (Drawing, 'metcap' , { 'color':'DarkTurquoise', 'pattern':'poids2.32'    , 'border':2, 'threshold':0.02*scale })
      , (Drawing, 'metal3' , { 'color':'LightPink'    , 'pattern':'antislash3.32', 'border':1, 'threshold':0.02*scale })
      , (Drawing, 'metal4' , { 'color':'Green'        , 'pattern':'antislash4.32', 'border':1, 'threshold':0.02*scale })
      , (Drawing, 'metal5' , { 'color':'Yellow'       , 'pattern':'antislash5.32', 'border':1, 'threshold':0.02*scale })
      , (Drawing, 'metal6' , { 'color':'Violet'       , 'pattern':'antislash2.32', 'border':1, 'threshold':0.02*scale })
      , (Drawing, 'metal7' , { 'color':'Violet'       , 'pattern':'antislash2.32', 'border':1, 'threshold':0.02*scale })
      , (Drawing, 'metal8' , { 'color':'Violet'       , 'pattern':'antislash2.32', 'border':1, 'threshold':0.02*scale })
      , (Drawing, 'metal9' , { 'color':'Violet'       , 'pattern':'antislash2.32', 'border':1, 'threshold':0.02*scale })
      , (Drawing, 'metal10', { 'color':'Violet'       , 'pattern':'antislash2.32', 'border':1, 'threshold':0.02*scale })

      # Group: Cuts (VIA holes)
      , (Group  , 'Cuts (VIA holes)')
      , (Drawing, 'cut0', { 'color':'Blue'     , 'pattern':'poids2.8'    , 'border':2, 'threshold':0.02*scale })
      , (Drawing, 'cut1', { 'color':'Aqua'     , 'pattern':'antipoids2.8', 'border':2, 'threshold':0.02*scale })
      , (Drawing, 'cut2', { 'color':'LightPink', 'pattern':'poids2.8'    , 'border':2, 'threshold':0.02*scale })
      , (Drawing, 'cut3', { 'color':'Green'    , 'pattern':'antipoids2.8', 'border':2, 'threshold':0.02*scale })
      , (Drawing, 'cut4', { 'color':'Yellow'   , 'pattern':'poids2.8'    , 'border':2, 'threshold':0.02*scale })
      , (Drawing, 'cut5', { 'color':'Violet'   , 'pattern':'antipoids2.8', 'border':2, 'threshold':0.02*scale })
      , (Drawing, 'cut6', { 'color':'Violet'   , 'pattern':'antipoids2.8', 'border':2, 'threshold':0.02*scale })
      , (Drawing, 'cut7', { 'color':'Violet'   , 'pattern':'antipoids2.8', 'border':2, 'threshold':0.02*scale })
      , (Drawing, 'cut8', { 'color':'Violet'   , 'pattern':'antipoids2.8', 'border':2, 'threshold':0.02*scale })
      , (Drawing, 'cut9', { 'color':'Violet'   , 'pattern':'antipoids2.8', 'border':2, 'threshold':0.02*scale })

      # Group: MIM6.
      , (Group  , 'MIM6')
     #, (Drawing, 'topmim6' , { 'color':'Blue'     , 'pattern':'poids2.8'         , 'threshold':0.80*scale })
      , (Drawing, 'metbot_r', { 'color':'Aqua'     , 'pattern':'light_antihash0.8', 'threshold':0.80*scale })
      , (Drawing, 'cut6'    , { 'color':'LightPink', 'pattern':'light_antihash1.8', 'threshold':0.80*scale })
      , (Drawing, 'metal7'  , { 'color':'Green'    , 'pattern':'light_antihash2.8', 'threshold':0.80*scale })

      # Group: Blockages.
      , (Group  , 'Blockages')
      , (Drawing, 'blockage1' , { 'color':'Blue'     , 'pattern':'006070381c0e0703' , 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'blockage2' , { 'color':'Aqua'     , 'pattern':'8103060c183060c0' , 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'blockage3' , { 'color':'LightPink', 'pattern':'poids4.8'         , 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'blockage4' , { 'color':'Green'    , 'pattern':'light_antihash2.8', 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'blockage5' , { 'color':'Yellow'   , 'pattern':'1144114411441144' , 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'blockage6' , { 'color':'Violet'   , 'pattern':'light_antihash0.8', 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'blockage7' , { 'color':'Violet'   , 'pattern':'light_antihash0.8', 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'blockage8' , { 'color':'Violet'   , 'pattern':'light_antihash0.8', 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'blockage9' , { 'color':'Violet'   , 'pattern':'light_antihash0.8', 'threshold':0.80*scale, 'border':2 })
      , (Drawing, 'blockage10', { 'color':'Violet'   , 'pattern':'light_antihash0.8', 'threshold':0.80*scale, 'border':2 })

      # Group: Knik & Kite.
      , (Group  , 'Knik & Kite')
      , (Drawing, 'SPL1'     , { 'color':'Red'        })
      , (Drawing, 'AutoLayer', { 'color':'Magenta'    })
      , (Drawing, 'gmetalh'  , { 'color':'128,255,200', 'pattern':'light_antihash0.8' , 'border':1 })
      , (Drawing, 'gmetalv'  , { 'color':'200,200,255', 'pattern':'light_antihash1.8' , 'border':1 })
      , (Drawing, 'gcut'     , { 'color':'255,255,190', 'border':1 })
      , (Drawing, 'Anabatic::Edge' , { 'color':'255,255,190', 'pattern':'0000000000000000', 'border':4 })
      , (Drawing, 'Anabatic::GCell', { 'color':'255,255,190', 'pattern':'0000000000000000', 'border':4 })
      )
    )
