Quintiq file version 2.0
#parent: #root
Method ColorBackgroundBasedOnSeverity (
  internal[DrawElementInfo] drawinfo,
  LibOpt_Issue element
) id:Method_LibOpt_FormIssue_ColorBackgroundBasedOnSeverity
{
  #keys: '[142652.0.2051816993]'
  Body:
  [*
    // Color background based on `LibOpt_Issue::Severity`.
    
    rel_severity := sqr( element.Severity() ) / sqr( LibOpt_Issue::Severity_5_Max() );
    
    drawinfo.BackgroundColor( Color::Color( LibOpt_GlobalState.MaxColorValue(),
                                            [Number] ( LibOpt_GlobalState.MaxColorValue() * ( 1 - rel_severity ) ),
                                            [Number] ( LibOpt_GlobalState.MaxColorValue() * ( 1 - rel_severity ) ),
                                            0.42
                                          )
                            );
  *]
  Declarative: true
}
