diff --git a/include/libdraw.h b/include/libdraw.h
index 34253813ac5f93011ed8a18c8856fa2667bf7344..e245f75905b8d8092b257e65df6e20db3910db31 100644
--- a/include/libdraw.h
+++ b/include/libdraw.h
@@ -9,12 +9,11 @@
   *
   * @version 1.0.0
   * @author Raphael Boucherie
-  * @author Matthieu Faverge
+  * @author Mathieu Faverge
   * @date 2017-04-04
   *
   **/
 
-#include <stdio.h>
 #ifndef _LIBDRAW_H_
 #define _LIBDRAW_H_
 
@@ -22,6 +21,12 @@
 
 BEGIN_C_DECLS
 
+/*
+ * Clobal array for color
+ */
+
+extern char *color[4];
+
 /*
  * function for treedraw
  */
diff --git a/src/treedraw.c b/src/treedraw.c
index 5ffa182f303634bab8b9d821bb3b4cec359fd3d1..b714078a9a777e5a15abb778f484982e9a012dde 100644
--- a/src/treedraw.c
+++ b/src/treedraw.c
@@ -18,14 +18,20 @@
 #include <stdio.h>
 #include "libdraw.h"
 
+/*
+ * Global array for color
+ */
+
+char *color[4] = {"red", "blue", "green", "purple"};
+
 /*
  * functions writing in the svg file
  */
 
 void libhqr_writeheader(FILE *tree){
-    if(fprintf(tree, "<?xml version=\"1.0\" standalone=\"no\"?>\n") < 0) return;
-    if(fprintf(tree, "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n ") < 0) return;
-    if(fprintf(tree, "<svg width=\"2000\" height=\"2000\" version=\"1.1\" \n xmlns=\"http://www.w3.org/2000/svg\">\n") <0) return;
+    if(fprintf(tree, "<?xml version=\"1.0\" standalone=\"no\"?>\n"
+     "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n"
+     "<svg width=\"2000\" height=\"2000\" version=\"1.1\" \n xmlns=\"http://www.w3.org/2000/svg\">\n") <0) return;
 }
 
 /*
@@ -38,41 +44,13 @@ void libhqr_writeheader(FILE *tree){
  */
 
 void libhqr_drawTT(int x, int y, int w, int h, int k, FILE *tree){
-    switch (k % 4){
-    case 0 :
-        if(fprintf(tree,"<rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" fill=\"red\" /> \n", x, y, w, h) < 0 ) return;
-        break;
-    case 1 :
-        if(fprintf(tree,"<rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" fill=\"blue\" /> \n", x, y, w, h) < 0 ) return;
-        break;
-    case 2 :
-        if(fprintf(tree,"<rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" fill=\"green\" /> \n", x, y, w, h) < 0 ) return;
-        break;
-    case 3 :
-        if(fprintf(tree,"<rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" fill=\"black\" /> \n", x, y, w, h) < 0 ) return;
-        break;
-    default:
+    if(fprintf(tree,"<rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" fill=\"%s\" /> \n", x, y, w, h, color[k%4]) < 0 )
         return;
-    }
 }
 
 void libhqr_drawTS(int x, int y, int w, int h, int k, FILE *tree){
-    switch (k % 4){
-    case 0 :
-        if(fprintf(tree,"<rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" fill=\"red\" /> \n", x, y, w, h) < 0 ) return;
-        break;
-    case 1 :
-        if(fprintf(tree,"<rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" fill=\"blue\" /> \n", x, y, w, h) < 0 ) return;
-        break;
-    case 2 :
-        if(fprintf(tree,"<rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" fill=\"green\" /> \n", x, y, w, h) < 0 ) return;
-        break;
-    case 3 :
-        if(fprintf(tree,"<rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" fill=\"black\" /> \n", x, y, w, h) < 0 ) return;
-        break;
-    default:
+    if(fprintf(tree,"<rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" fill=\"%s\" /> \n", x, y, w, h, color[k%4]) < 0 )
         return;
-    }
     int x2 = x + (w / 4);
     int y2 = y + (h / 4);
     int w2 = (w / 2);
diff --git a/testings/testing_treedraw.c b/testings/testing_treedraw.c
index f2fdd7b8e48e28f43d85061991f5510ecf40f5bf..773d23aa23217ce86e6daaa59be3fc9050565e6b 100644
--- a/testings/testing_treedraw.c
+++ b/testings/testing_treedraw.c
@@ -33,7 +33,7 @@ main(int argc, char ** argv)
       for (j = 1; j < 9; j++){
           x = 100*i;
           y = 100*j;
-          libhqr_drawTS(x,y,WIDTH,HEIGHT,1,tree);
+          libhqr_drawTS(x,y,WIDTH,HEIGHT,3,tree);
       }
   }
   libhqr_writeend(tree);