INNER CODE UNIT · Ruby
String
Automattic/pocket-casts-android · scripts/themes/generate_kotlin.rb:11
class String
def uncapitalize
self[0, 1].downcase + self[1..]
end
end
def write_theme_value(hex_val, opacity, token_name, file_path, theme_name)
if token_name.start_with?('filterU') || token_name.start_with?('filterI') || token_name.start_with?('filterT')
str = ''
# deal with special filter overlay colours
if ['filter', '$filter', '#filter'].include?(hex_val)
# the ones without any custom opacity are easy
if opacity == '100%' || opacity.nil? || opacity.empty?
str = " @ColorInt fun #{token_name}#{theme_name}(@ColorInt filterColor: Int): Int {
return filterColor
}\n\n"
else
# tokenize the filter colour to figure out what it should be