Quintiq file version 2.0
#parent: #root
Method GetColorScheme (
  String definitionname
) as internal[Color] id:Method_ApplicationLibMacroPlanner_GetColorScheme
{
  #keys: '[11660.0.549111060]'
  Body:
  [*
    // Get color scheme
    colorscheme := ApplicationScope.ColorSchemeManager().ActiveColorScheme();
    
    colorschemeentry := select( colorscheme,
                                Accessors.Entry.astype( ColorSchemeEntry ),
                                e,
                                e.Definition().Name() = definitionname );
    
    manager := ApplicationScope.Project().ColorSchemeManager();
    scheme  := manager.Edit( ApplicationScope.SessionMDS(), colorscheme );
    lock    := scheme.AcquireLock();
    
    dlg := construct( dlgEditColorSchemeEntry );
    dlg.Data( colorschemeentry );
    dlg.dhLockHolder().Data( lock );
    
    result := dlg.DoModal(this);
    
    if( result > 0 )
    {
      manager.Apply( colorscheme, lock );
    }
    
    return colorschemeentry.Color();
  *]
}
