Method: Nyaplot::Color#to_html
- Defined in:
- lib/nyaplot/color.rb
#to_html ⇒ String
display colorset on IRuby notebook as a html table
64 65 66 67 68 69 70 71 |
# File 'lib/nyaplot/color.rb', line 64 def to_html html = '<table><tr>' @source.each{|color| html.concat("<th>" + color + "</th>")} html.concat("</tr><tr>") @source.each{|color| html.concat("<td style=\"background-color:" + color + ";\"> </td>")} html += '</tr></table>' return html end |