Skip to content

Commit

Permalink
Add grayscale option
Browse files Browse the repository at this point in the history
  • Loading branch information
giginet committed Mar 28, 2018
1 parent 4c6f17c commit 72b12c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/badge/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ def self.available_options

FastlaneCore::ConfigItem.new(key: :glob,
description: "Glob pattern for finding image files Default: CURRENT_PATH/**/*.appiconset/*.{png,PNG}",
optional: true),

FastlaneCore::ConfigItem.new(key: :grayscale,
description: "Whether making icons to grayscale",
is_string: false,
default_value: false,
optional: true)
]
end
Expand Down
4 changes: 4 additions & 0 deletions lib/badge/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ def run(path, options)
result = add_shield(icon, result, shield, alpha_channel, options[:shield_gravity], options[:shield_no_resize], options[:shield_scale], options[:shield_geometry])
icon_changed = true
end
if options[:grayscale]
result.colorspace 'gray'
icon_changed = true
end

if icon_changed
result.format "png"
Expand Down

0 comments on commit 72b12c4

Please sign in to comment.