Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
placehold.jp さんを利用してサンプル画像ファイルを作成しまくる
%w[
160x90
160x120
320x180
320x240
640x360
640x480
1280x720
1280x960
].each do |size|
%w[png jpg].each do |ext|
(1..5).each do |count|
color1 = (0..5).map { rand(15).to_s(16) }.join
color2 = color1.chars.map { |c| (16 - c.to_i(16)).to_s(16) }.join
system "wget http://placehold.jp/24/#{color1}/#{color2}/#{size}.#{ext}?text=#{size}-#{count}-#{ext} -O #{size}-#{count}.#{ext}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.