Skip to content

An enjoyable stroll through the rainbow #1

@megazear7

Description

@megazear7
colors = [ [255, 0, 0], [255, 127, 0], 
[255, 255, 0], [0, 255, 0], [0, 0, 255], 
[75, 0, 255], [143,0, 255] ].each_with_position do |step, position|
 next = colors[position+1]
 red = step[0]
 red_next = next[0]
 green = step[1]
 green_next = next[1]
 blue = step[2]
 blue_next = next[2]
 rdelta = red_next - red
 gdelta = green_next - green
 bdelta = blue_next - blue
 (num_of_tests / 6).each do |single_test|
   r = red + rdelta
   g = green + gdelta
   b = blue + bdelta
   # rgb are your colors for this test
  end
end

This creates a single rainbow of colors over all your tests instead of repeating the rainbow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions