title: error when coloring clusters using igraph
body: <p>I'm using K-means to clustering a network using igraph
  I got error when trying to print the clusters using igraph.
  but it works well in networkX</p>
  <p>File &quot;C:\Anaconda\lib\site-packages\igraph\drawing\colors.py&quot;, line 480, in color_name_to_rgba
  components = palette.get(color)</p>
  <p>AttributeError: 'NoneType' object has no attribute 'get'</p>
  <p>During handling of the above exception, another exception occurred:</p>
  <p>Traceback (most recent call last):</p>
  <p>File &quot;C:\Users\mon pc\Desktop\FSSM\python\MasterPython\Projet_Master_SD1\Projet_Master_SD1\untitled5.py&quot;, line 59, in 
  igraph.plot(G).show()</p>
  <p>File &quot;C:\Anaconda\lib\site-packages\igraph\drawing_<em>init</em>_.py&quot;, line 333, in show
  self.redraw(ctx)</p>
  <p>File &quot;C:\Anaconda\lib\site-packages\igraph\drawing_<em>init</em>_.py&quot;, line 276, in redraw
  plotter(ctx, bbox, palette, *args, **kwds)</p>
  <p>File &quot;C:\Anaconda\lib\site-packages\igraph_<em>init</em>_.py&quot;, line 4166, in <strong>plot</strong>
  drawer.draw(self, palette, *args, **kwds)</p>
  <p>File &quot;C:\Anaconda\lib\site-packages\igraph\drawing\graph.py&quot;, line 266, in draw
  vertex_builder = vertex_drawer.VisualVertexBuilder(graph.vs, kwds)</p>
  <p>File &quot;C:\Anaconda\lib\site-packages\igraph\drawing\metamagic.py&quot;, line 219, in <strong>init</strong>
  values = self._collect_attributes(attr_spec)</p>
  <p>File &quot;C:\Anaconda\lib\site-packages\igraph\drawing\metamagic.py&quot;, line 336, in _collect_attributes
  result = [transform(x) for x in result]</p>
  <p>File &quot;C:\Anaconda\lib\site-packages\igraph\drawing\metamagic.py&quot;, line 336, in 
  result = [transform(x) for x in result]</p>
  <p>File &quot;C:\Anaconda\lib\site-packages\igraph\drawing\colors.py&quot;, line 94, in get
  result = color_name_to_rgba(v)</p>
  <p>File &quot;C:\Anaconda\lib\site-packages\igraph\drawing\colors.py&quot;, line 482, in color_name_to_rgba
  raise ValueError(&quot;palette index used when no palette was given&quot;)</p>
  <p>ValueError: palette index used when no palette was given</p>
  <p>Using networkX</p>
  <pre><code>from sklearn.cluster import KMeans
  import pandas as pd
  import networkx as nx
  
  
  data = pd.read_csv(&quot;C:/facebook_combined.txt&quot;,sep=&quot; &quot;,names=['Source','Target'])
  G = nx.from_pandas_edgelist(data,source=&quot;Source&quot;,target=&quot;Target&quot;)
  
  k=5
  km = KMeans(n_clusters=k)
  clusters = km.fit_predict(data)
  #print(&quot;clusters-------------------------------------\n&quot;,clusters)
  
  data[&quot;cluster&quot;] = clusters
  #print(&quot;data_clusters--------------------------------\n&quot;,ranked_data)
  
  centroids  = km.cluster_centers_ 
  #print(centroids)
  
  node_cluster = pd.DataFrame(data['Source'])
  node_cluster['cluster'] = data['cluster']
  
  
  dictionary = node_cluster.to_dict('split')
  
  
  temp_list = []
  
  for i in dictionary['data']:
      if i not in temp_list:
          temp_list.append(i)
  my_list = temp_list
  
  dict_list = dict(my_list)
  
  
  values = [dict_list.get(node, 0.25) for node in G.nodes()]
  nx.draw(G, node_color=values)
  plt.show()
  </code></pre>
  <p>Using igraph</p>
  <pre><code>import pandas as pd
  
  from igraph import *
  import igraph
  
  
  data = pd.read_csv(&quot;C:/facebook_combined.txt&quot;,sep=&quot; &quot;,names=['Source','Target'])
  G = Graph.Read_Edgelist('C:/facebook_combined.txt',directed=False)
  
  k=5
  km = KMeans(n_clusters=k)
  clusters = km.fit_predict(data)
  #print(&quot;clusters-------------------------------------\n&quot;,clusters)
  
  data[&quot;cluster&quot;] = clusters
  #print(&quot;data_clusters--------------------------------\n&quot;,ranked_data)
  
  centroids  = km.cluster_centers_ 
  #print(centroids)
  
  node_cluster = pd.DataFrame(data['Source'])
  node_cluster['cluster'] = data['cluster']
  
  
  dictionary = node_cluster.to_dict('split')
  
  
  temp_list = []
  
  for i in dictionary['data']:
      if i not in temp_list:
          temp_list.append(i)
  my_list = temp_list
  
  dict_list = dict(my_list)
  
  
  values = [dict_list.get(node, 0.25) for node in G.vs.indices]
  #nx.draw(G, node_color=values)
  #plt.show()
  
  G.vs[&quot;color&quot;] = values 
  igraph.plot(G).show()
  </code></pre>
  <p>Any suggestions !! Thank you</p>