title: Hexadecimal colors in ggplot not colored as expected
body: <p><strong>EDIT:</strong></p>
  
  <p>I asked a question which boils down to this:  </p>
  
  <p>"How can I get ggplot to use hexadecimal colors?"  </p>
  
  <p>The answer by MrFick was excellent.  </p>
  
  <p>My original question had a terrible typo (read the comments). Instead of deleting this flawed question, I'd recommend just not reading anything below this and then reading the accepted solution. Thanks.</p>
  
  <p><strong>:END OF EDIT</strong></p>
  
  <p>I have plotted a few <code>geom_segment</code> layers, to make what looks like a vertical bar.</p>
  
  <pre><code>p &lt;- p + geom_segment(data=DF_for_plotting, aes(x=value[1], xend=value[2]-0.001, y=1, yend=1, colour="green"), size=10)
  p &lt;- p + geom_segment(data=DF_for_plotting, aes(x=value[2], xend=value[3]-0.001, y=1, yend=1, colour="blue"), size=10)
  p &lt;- p + geom_segment(data=DF_for_plotting, aes(x=value[3], xend=value[4]-0.001, y=1, yend=1, colour="red"), size=10)
  p
  </code></pre>
  
  <p>This gives me:</p>
  
  <p><img src="https://i.stack.imgur.com/zATeN.png" alt="enter image description here"></p>
  
  <p>For some reason, when I try to replace <code>red</code> with <code>"#CC6666"</code>, replace <code>green</code> with <code>"#9999CC"</code>, and replace <code>blue</code> with <code>"#66CC99"</code>, as such,</p>
  
  <pre><code>q &lt;- ggplot()
  q &lt;- q + geom_segment(data=DF_for_plotting, aes(x=value[1], xend=value[2]-0.001, y=1, yend=1, colour="#66CC99"), size=10)
  q &lt;- q + geom_segment(data=DF_for_plotting, aes(x=value[2], xend=value[3]-0.001, y=1, yend=1, colour="#9999CC"), size=10)
  q &lt;- q + geom_segment(data=DF_for_plotting, aes(x=value[3], xend=value[4]-0.001, y=1, yend=1, colour="#CC6666"), size=10)
  </code></pre>
  
  <p>I get:</p>
  
  <p><img src="https://i.stack.imgur.com/xzrsY.png" alt="enter image description here"></p>
  
  <p>Do I somehow need to reset the colors after each plot? And why would I need to do that?  </p>
  
  <p>(FFIW, I'm also working in Shiny, where I'm making a set of 6 plots, dynamically. If this is an issue relating to how color is defined in an environment, I might have some extra pain.)</p>
  
  <p>Any help would be appreciated. </p>
  
  <p>The data lives <a href="https://www.dropbox.com/s/6hkc3mth9oimlk5/DF_for_plotting.csv?dl=0" rel="nofollow noreferrer">here</a> and the code is here:</p>
  
  <pre><code>library(ggplot2)
  library(gridExtra)
  
  #DF_for_plotting lives here: https://www.dropbox.com/s/6hkc3mth9oimlk5/DF_for_plotting.csv?dl=0
  
  p &lt;- ggplot()
  p &lt;- p + geom_segment(data=DF_for_plotting, aes(x=value[1], xend=value[2]-0.001, y=1, yend=1, colour="green"), size=10)
  p &lt;- p + geom_segment(data=DF_for_plotting, aes(x=value[2], xend=value[3]-0.001, y=1, yend=1, colour="blue"), size=10)
  p &lt;- p + geom_segment(data=DF_for_plotting, aes(x=value[3], xend=value[4]-0.001, y=1, yend=1, colour="red"), size=10)
  
  q &lt;- ggplot()
  q &lt;- p + geom_segment(data=DF_for_plotting, aes(x=value[1], xend=value[2]-0.001, y=1, yend=1, colour="#66CC99"), size=10)
  q &lt;- p + geom_segment(data=DF_for_plotting, aes(x=value[2], xend=value[3]-0.001, y=1, yend=1, colour="#9999CC"), size=10)
  q &lt;- p + geom_segment(data=DF_for_plotting, aes(x=value[3], xend=value[4]-0.001, y=1, yend=1, colour="#CC6666"), size=10)
  
  grid.arrange(p,q, ncol=2)
  </code></pre>