title: Custom discrete color scale in plotly
body: <p>I would like to customize the colors in a <code>plotly</code> plot. This works fine for continuous variables and scales as per the <a href="https://plot.ly/r/user-guide/#sequential-color-mappings" rel="nofollow">docs</a>:</p>
  
  <pre><code>library(plotly)
  
  plot_ly(iris, x = Petal.Length, y = Petal.Width,
               color = Sepal.Length, colors = c("#132B43", "#56B1F7"),
               mode = "markers")
  </code></pre>
  
  <p>If I make the argument to color discrete (character or factor), however, this still works but throws a warning:</p>
  
  <pre><code>&gt; plot_ly(iris, x = Petal.Length, y = Petal.Width,
            color = Sepal.Length&gt;6, colors = c("#132B43", "#56B1F7"),
            mode = "markers")
  
  
  Warning message:
  In RColorBrewer::brewer.pal(N, "Set2") :
    minimal value for n is 3, returning requested palette with 3 different levels
  </code></pre>
  
  <p>How do I do this correctly?</p>