lib/issue_graph/issue/collection.rb
# Pick a color for each repository, then tell each issue what color to use.
# This is only used when outputting the graph.
Pick a color for each repository, then tell each issue what color to use.
This is only used when outputting the graph.
Pick a color for each repository then tell each issue what color to use . This is only used when outputting the graph .
def color_issues_by_repo
    color_list = %w{cornsilk azure aquamarine cyan2 darksalmon cadetblue1 greenyellow palegreen olivedrab1 plum1 pink1 sandybrown grey}
    colormap = {}
    colormap[repo_id] = "gold"
    self.each do |name, issue|
      unless color = colormap[issue[:repo_id]]
        unless color = color_list.shift
          raise "Ran out of colors!"
        end
        colormap[issue[:repo_id]] = color
      end
      issue[:fillcolor] = color
    end
  end
def color_issues_by_repo color_list = %w{ cornsilk azure aquamarine cyan2 darksalmon cadetblue1 greenyellow palegreen olivedrab1 plum1 pink1 sandybrown grey } colormap = { } colormap [ repo_id ] = "gold" self . each do | name , issue | unless color = colormap [ issue [ :repo_id ] ] unless color = color_list . shift raise "Ran out of colors!" end colormap [ issue [ :repo_id ] ] = color end issue [ :fillcolor ] = color end end
Pick a color for each repository, then tell each issue what color to use.
Pick a color for each repository then tell each issue what color to use .
# This will need to be done differently. # Ideally I'd color each repo a different color. # Our main repo is always gold. # For coloring the node in the graph # Pick a new color, if there isn't one already set for this repo.