// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.execution.process;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.awt.*;

/**
 * Interface to work with ANSI-defined terminal colors
 */
interface AnsiTerminalColor {
  /**
   * @return command part for serializing this color.
   * @implSpec this method MUST NOT return an escape sequence. Only the part that should be wrapped to {@link #SGR_COMMAND_FG_COLOR_ENCODED} or
   * {@link #SGR_COMMAND_BG_COLOR_ENCODED}. E.g. {@code 2;255;255;255 }
   */
  @NotNull
  String getAnsiEncodedColor();

  /**
   * @return a {@link java.awt.Color color} representing this one or null if this is a pre-set configurable color 0-15
   */
  @Nullable
  Color getColor();

  /**
   * @return a color index for this terminal color if available. Returns {@code -1} for pure RGB encoded color
   */
  int getColorIndex();
}

@@ -339,16 +339,17 @@
 l colors
+.
 %0A */%0Aint
@@ -537,32 +537,44 @@
 apped to %7B@link 
+AnsiCommands
 #SGR_COMMAND_FG_
@@ -603,16 +603,28 @@
  %7B@link 
+AnsiCommands
 #SGR_COM
@@ -753,25 +753,16 @@
  %7B@link 
-java.awt.
 Color co
@@ -795,12 +795,20 @@
  or 
+%7B@code 
 null
+%7D
  if 
@@ -848,16 +848,17 @@
 lor 0-15
+.
 %0A   */%0A 
@@ -1005,16 +1005,17 @@
 ed color
+.
 %0A   */%0A 

fix Javadoc