patch 8.2.4982: colors in terminal window are not 100% correct

Problem:    Colors in terminal window are not 100% correct.
Solution:   Use g:terminal_ansi_colors as documented. (closes #10429,
            closes #7227 closes #10347)
diff --git a/src/term.c b/src/term.c
index ef3cf94..7449d88 100644
--- a/src/term.c
+++ b/src/term.c
@@ -6730,7 +6730,7 @@
     0x80, 0x8A, 0x94, 0x9E, 0xA8, 0xB2, 0xBC, 0xC6, 0xD0, 0xDA, 0xE4, 0xEE
 };
 
-static char_u ansi_table[16][3] = {
+static const char_u ansi_table[16][3] = {
 //   R    G    B
   {  0,   0,   0}, // black
   {224,   0,   0}, // dark red
@@ -6761,6 +6761,25 @@
 #define ANSI_INDEX_NONE 0
 
     void
+ansi_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u *ansi_idx)
+{
+    if (nr < 16)
+    {
+	*r = ansi_table[nr][0];
+	*g = ansi_table[nr][1];
+	*b = ansi_table[nr][2];
+	*ansi_idx = nr;
+    }
+    else
+    {
+	*r = 0;
+	*g = 0;
+	*b = 0;
+	*ansi_idx = ANSI_INDEX_NONE;
+    }
+}
+
+    void
 cterm_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u *ansi_idx)
 {
     int idx;