Finding a good color - usage

/ Published in: Ruby
Save to your folder(s)

Copy this code and paste it in your HTML
  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


RSS Icon Subscribe to comments

You need to login to post a comment.