public override void ActivateOptions()

in src/log4net/Appender/AnsiColorTerminalAppender.cs [382:433]


    public override void ActivateOptions()
    {
      base.ActivateOptions();

      StringBuilder buf = new();

      // Reset any existing codes
      buf.Append("\x1b[0;");

      int lightAdjustment = ((Attributes & AnsiAttributes.Light) > 0) ? 60 : 0;

      // set the foreground color
      buf.Append(30 + lightAdjustment + (int)ForeColor);
      buf.Append(';');

      // set the background color
      buf.Append(40 + lightAdjustment + (int)BackColor);

      // set the attributes
      if ((Attributes & AnsiAttributes.Bright) > 0)
      {
        buf.Append(";1");
      }
      if ((Attributes & AnsiAttributes.Dim) > 0)
      {
        buf.Append(";2");
      }
      if ((Attributes & AnsiAttributes.Underscore) > 0)
      {
        buf.Append(";4");
      }
      if ((Attributes & AnsiAttributes.Blink) > 0)
      {
        buf.Append(";5");
      }
      if ((Attributes & AnsiAttributes.Reverse) > 0)
      {
        buf.Append(";7");
      }
      if ((Attributes & AnsiAttributes.Hidden) > 0)
      {
        buf.Append(";8");
      }
      if ((Attributes & AnsiAttributes.Strikethrough) > 0)
      {
        buf.Append(";9");
      }

      buf.Append('m');

      CombinedColor = buf.ToString();
    }