Posted By

rduv on 10/11/06


Tagged

color


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

webstic


Finding a good color - usage


 / Published in: Ruby
 

  1. possible_colors = [0xff0000, 0x00ff00, 0x0000ff, 0xffff00, 0x00ffff, 0xffffff]
  2. good_color = 0 # We can default to black...
  3. possible_colors.each do |c|
  4. if colors_diff_ok? c, my_color
  5. good_color = c
  6. break
  7. end
  8. end

Report this snippet  

You need to login to post a comment.