improve colours script (but not its name, which is still silly)

This commit is contained in:
Sami Samhuri 2017-03-10 16:51:56 -08:00
parent 53f3a62d38
commit a717b5f516

View file

@ -31,6 +31,19 @@ redf ||= red.to_f / 255
greenf ||= green.to_f / 255
bluef ||= blue.to_f / 255
puts "Red: #{red} / #{redf}"
puts "Green: #{green} / #{greenf}"
puts "Blue: #{blue} / #{bluef}"
puts
puts '#' + hex
puts "RGB (#{red}, #{green}, #{blue})"
puts "Red:#{redf} green:#{greenf} blue:#{bluef}"
puts "rgb(#{red}, #{green}, #{blue})"
puts
if red == green && green == blue
puts "[UIColor colorWithWhite:#{'%0.3g' % redf} alpha:1]"
puts "UIColor(white: #{'%0.3g' % redf}, alpha: 1)"
end
puts "[UIColor colorWithRed:#{red}/255.0 green:#{green}/255.0 blue:#{blue}/255.0 alpha:1]"
puts "UIColor(red: #{red}/255.0, green: #{green}/255.0, blue: #{blue}/255.0, alpha: 1)"