From: Florian Frank Date: 2006-09-07T03:00:23+09:00 Subject: Fix: no black boxes in rdoc diagrams anymore --------------030306050307030009040800 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, rdoc uses graphviz dot to create diagrams. Sometimes color names like lightcyan1 aren't defined (in the running X system?). This leads to graphviz falling back to black color, which doesn't look very nice. I have included a patch, that uses the corresponding #xxxxxx hex numbers instead of the all the names to make rdoc more portable. -- Florian Frank --------------030306050307030009040800 Content-Type: text/x-patch; name="rdoc.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="rdoc.patch" Index: diagram.rb =================================================================== RCS file: /src/ruby/lib/rdoc/diagram.rb,v retrieving revision 1.2.2.1 diff -u -p -r1.2.2.1 diagram.rb --- diagram.rb 16 Jul 2004 20:27:29 -0000 1.2.2.1 +++ diagram.rb 6 Sep 2006 17:46:43 -0000 @@ -58,14 +58,14 @@ module RDoc 'label' => i.file_absolute_name, 'fontname' => FONT, 'fontsize' => '8', - 'bgcolor' => 'lightcyan1', + 'bgcolor' => '"#e0ffff"', 'compound' => 'true') # it's a little hack %) i'm too lazy to create a separate class # for default node graph << DOT::DOTNode.new('name' => 'node', 'fontname' => FONT, - 'color' => 'black', + 'color' => '"#000000"', 'fontsize' => 8) i.modules.each do |mod| @@ -86,12 +86,12 @@ module RDoc 'label' => i.full_name, 'fontname' => FONT, 'fontsize' => '8', - 'bgcolor' => 'lightcyan1', + 'bgcolor' => '"#e0ffff"', 'compound' => 'true') graph << DOT::DOTNode.new('name' => 'node', 'fontname' => FONT, - 'color' => 'black', + 'color' => '"#000000"', 'fontsize' => 8) draw_module(mod, graph, true) mod.diagram = convert_to_png("m_#{file_count}_#{count}", @@ -132,10 +132,10 @@ module RDoc m = DOT::DOTSubgraph.new('name' => "cluster_#{mod.full_name.gsub( /:/,'_' )}", 'label' => mod.name, 'fontname' => FONT, - 'color' => 'blue', + 'color' => '"#0000ff"', 'style' => 'filled', 'URL' => %{"#{url}"}, - 'fillcolor' => toplevel ? 'palegreen1' : 'palegreen3') + 'fillcolor' => toplevel ? '"#9aff9a"' : '"#7ccd7c"') @done_modules[mod.full_name] = m add_classes(mod, m, file) @@ -193,7 +193,7 @@ module RDoc 'label' => "#{last_file}", 'fontname' => FONT, 'color'=> - last_file == file ? 'red' : 'black') + last_file == file ? '"#ff0000"' : '"#000000"') end next if cl.name == 'Object' || cl.name[0,2] == "<<" @@ -211,9 +211,9 @@ module RDoc attrs = { 'name' => "#{cl.full_name.gsub( /:/, '_' )}", - 'fontcolor' => 'black', + 'fontcolor' => '"#000000"', 'style'=>'filled', - 'color'=>'palegoldenrod', + 'color'=>'"#eee8aa"', 'label' => label, 'shape' => 'ellipse', 'URL' => %{"#{url}"} --------------030306050307030009040800--