diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChrome.imageset/Contents.json b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChrome.imageset/Contents.json index 8c470e5..0549a69 100644 --- a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChrome.imageset/Contents.json +++ b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChrome.imageset/Contents.json @@ -1,21 +1,43 @@ { - "images" : [ + "images": [ { - "idiom" : "mac", - "filename" : "DefaultBrowserChrome@1x.png", - "scale" : "1x" + "idiom": "mac", + "filename": "DefaultBrowserChrome@1x.png", + "scale": "1x" }, { - "idiom" : "mac", - "filename" : "DefaultBrowserChrome@2x.png", - "scale" : "2x" + "idiom": "mac", + "filename": "DefaultBrowserChrome@2x.png", + "scale": "2x" + }, + { + "idiom": "mac", + "filename": "DefaultBrowserChrome_Dark@1x.png", + "scale": "1x", + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ] + }, + { + "idiom": "mac", + "filename": "DefaultBrowserChrome_Dark@2x.png", + "scale": "2x", + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ] } ], - "info" : { - "version" : 1, - "author" : "xcode" + "info": { + "version": 1, + "author": "xcode" }, - "properties" : { - "template-rendering-intent" : "template" + "properties": { + "template-rendering-intent": "template" } -} \ No newline at end of file +} diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChrome.imageset/DefaultBrowserChrome_Dark@1x.png b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChrome.imageset/DefaultBrowserChrome_Dark@1x.png new file mode 100644 index 0000000..786c828 Binary files /dev/null and b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChrome.imageset/DefaultBrowserChrome_Dark@1x.png differ diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChrome.imageset/DefaultBrowserChrome_Dark@2x.png b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChrome.imageset/DefaultBrowserChrome_Dark@2x.png new file mode 100644 index 0000000..b635580 Binary files /dev/null and b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChrome.imageset/DefaultBrowserChrome_Dark@2x.png differ diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChromeCanary.imageset/Contents.json b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChromeCanary.imageset/Contents.json index 252ed2d..22ee981 100644 --- a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChromeCanary.imageset/Contents.json +++ b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChromeCanary.imageset/Contents.json @@ -1,21 +1,43 @@ { - "images" : [ + "images": [ { - "idiom" : "mac", - "filename" : "DefaultBrowserChromeCanary@1x.png", - "scale" : "1x" + "idiom": "mac", + "filename": "DefaultBrowserChromeCanary@1x.png", + "scale": "1x" }, { - "idiom" : "mac", - "filename" : "DefaultBrowserChromeCanary@2x.png", - "scale" : "2x" + "idiom": "mac", + "filename": "DefaultBrowserChromeCanary@2x.png", + "scale": "2x" + }, + { + "idiom": "mac", + "filename": "DefaultBrowserChromeCanary_Dark@1x.png", + "scale": "1x", + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ] + }, + { + "idiom": "mac", + "filename": "DefaultBrowserChromeCanary_Dark@2x.png", + "scale": "2x", + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ] } ], - "info" : { - "version" : 1, - "author" : "xcode" + "info": { + "version": 1, + "author": "xcode" }, - "properties" : { - "template-rendering-intent" : "template" + "properties": { + "template-rendering-intent": "template" } -} \ No newline at end of file +} diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChromeCanary.imageset/DefaultBrowserChromeCanary_Dark@1x.png b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChromeCanary.imageset/DefaultBrowserChromeCanary_Dark@1x.png new file mode 100644 index 0000000..569a77c Binary files /dev/null and b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChromeCanary.imageset/DefaultBrowserChromeCanary_Dark@1x.png differ diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChromeCanary.imageset/DefaultBrowserChromeCanary_Dark@2x.png b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChromeCanary.imageset/DefaultBrowserChromeCanary_Dark@2x.png new file mode 100644 index 0000000..b92bfc9 Binary files /dev/null and b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageChromeCanary.imageset/DefaultBrowserChromeCanary_Dark@2x.png differ diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageFirefox.imageset/Contents.json b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageFirefox.imageset/Contents.json index ea34902..0ee1035 100644 --- a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageFirefox.imageset/Contents.json +++ b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageFirefox.imageset/Contents.json @@ -1,21 +1,43 @@ { - "images" : [ + "images": [ { - "idiom" : "mac", - "filename" : "DefaultBrowserFirefox@1x.png", - "scale" : "1x" + "idiom": "mac", + "filename": "DefaultBrowserFirefox@1x.png", + "scale": "1x" }, { - "idiom" : "mac", - "filename" : "DefaultBrowserFirefox@2x.png", - "scale" : "2x" + "idiom": "mac", + "filename": "DefaultBrowserFirefox@2x.png", + "scale": "2x" + }, + { + "idiom": "mac", + "filename": "DefaultBrowserFirefox_Dark@1x.png", + "scale": "1x", + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ] + }, + { + "idiom": "mac", + "filename": "DefaultBrowserFirefox_Dark@2x.png", + "scale": "2x", + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ] } ], - "info" : { - "version" : 1, - "author" : "xcode" + "info": { + "version": 1, + "author": "xcode" }, - "properties" : { - "template-rendering-intent" : "template" + "properties": { + "template-rendering-intent": "template" } -} \ No newline at end of file +} diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageFirefox.imageset/DefaultBrowserFirefox_Dark@1x.png b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageFirefox.imageset/DefaultBrowserFirefox_Dark@1x.png new file mode 100644 index 0000000..a12da3c Binary files /dev/null and b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageFirefox.imageset/DefaultBrowserFirefox_Dark@1x.png differ diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageFirefox.imageset/DefaultBrowserFirefox_Dark@2x.png b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageFirefox.imageset/DefaultBrowserFirefox_Dark@2x.png new file mode 100644 index 0000000..9c198c6 Binary files /dev/null and b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageFirefox.imageset/DefaultBrowserFirefox_Dark@2x.png differ diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageOpera.imageset/Contents.json b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageOpera.imageset/Contents.json index 7c7e66a..6100942 100644 --- a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageOpera.imageset/Contents.json +++ b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageOpera.imageset/Contents.json @@ -1,21 +1,43 @@ { - "images" : [ + "images": [ { - "idiom" : "mac", - "filename" : "DefaultBrowserOpera@1x.png", - "scale" : "1x" + "idiom": "mac", + "filename": "DefaultBrowserOpera@1x.png", + "scale": "1x" }, { - "idiom" : "mac", - "filename" : "DefaultBrowserOpera@2x.png", - "scale" : "2x" + "idiom": "mac", + "filename": "DefaultBrowserOpera@2x.png", + "scale": "2x" + }, + { + "idiom": "mac", + "filename": "DefaultBrowserOpera_Dark@1x.png", + "scale": "1x", + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ] + }, + { + "idiom": "mac", + "filename": "DefaultBrowserOpera_Dark@2x.png", + "scale": "2x", + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ] } ], - "info" : { - "version" : 1, - "author" : "xcode" + "info": { + "version": 1, + "author": "xcode" }, - "properties" : { - "template-rendering-intent" : "template" + "properties": { + "template-rendering-intent": "template" } -} \ No newline at end of file +} diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageOpera.imageset/DefaultBrowserOpera_Dark@1x.png b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageOpera.imageset/DefaultBrowserOpera_Dark@1x.png new file mode 100644 index 0000000..a67a189 Binary files /dev/null and b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageOpera.imageset/DefaultBrowserOpera_Dark@1x.png differ diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageOpera.imageset/DefaultBrowserOpera_Dark@2x.png b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageOpera.imageset/DefaultBrowserOpera_Dark@2x.png new file mode 100644 index 0000000..925c552 Binary files /dev/null and b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageOpera.imageset/DefaultBrowserOpera_Dark@2x.png differ diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageSafari.imageset/Contents.json b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageSafari.imageset/Contents.json index ff710f0..e3058df 100644 --- a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageSafari.imageset/Contents.json +++ b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageSafari.imageset/Contents.json @@ -1,21 +1,43 @@ { - "images" : [ + "images": [ { - "idiom" : "mac", - "filename" : "DefaultBrowserSafari@1x.png", - "scale" : "1x" + "idiom": "mac", + "filename": "DefaultBrowserSafari@1x.png", + "scale": "1x" }, { - "idiom" : "mac", - "filename" : "DefaultBrowserSafari@2x.png", - "scale" : "2x" + "idiom": "mac", + "filename": "DefaultBrowserSafari@2x.png", + "scale": "2x" + }, + { + "idiom": "mac", + "filename": "DefaultBrowserSafari_Dark@1x.png", + "scale": "1x", + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ] + }, + { + "idiom": "mac", + "filename": "DefaultBrowserSafari_Dark@2x.png", + "scale": "2x", + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ] } ], - "info" : { - "version" : 1, - "author" : "xcode" + "info": { + "version": 1, + "author": "xcode" }, - "properties" : { - "template-rendering-intent" : "template" + "properties": { + "template-rendering-intent": "template" } -} \ No newline at end of file +} diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageSafari.imageset/DefaultBrowserSafari_Dark@1x.png b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageSafari.imageset/DefaultBrowserSafari_Dark@1x.png new file mode 100644 index 0000000..c45138b Binary files /dev/null and b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageSafari.imageset/DefaultBrowserSafari_Dark@1x.png differ diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageSafari.imageset/DefaultBrowserSafari_Dark@2x.png b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageSafari.imageset/DefaultBrowserSafari_Dark@2x.png new file mode 100644 index 0000000..795d8f0 Binary files /dev/null and b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageSafari.imageset/DefaultBrowserSafari_Dark@2x.png differ diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageVivaldi.imageset/Contents.json b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageVivaldi.imageset/Contents.json index 40d3f1c..07ad6c3 100644 --- a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageVivaldi.imageset/Contents.json +++ b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageVivaldi.imageset/Contents.json @@ -1,19 +1,39 @@ { "images" : [ { - "idiom" : "mac", "filename" : "DefaultBrowserVivaldi@1x.png", + "idiom" : "mac", "scale" : "1x" }, { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], "idiom" : "mac", + "scale" : "1x" + }, + { "filename" : "DefaultBrowserVivaldi@2x.png", + "idiom" : "mac", + "scale" : "2x" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "mac", "scale" : "2x" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 }, "properties" : { "template-rendering-intent" : "template" diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageWaterfox.imageset/Contents.json b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageWaterfox.imageset/Contents.json index 332ae48..5009948 100644 --- a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageWaterfox.imageset/Contents.json +++ b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageWaterfox.imageset/Contents.json @@ -1,19 +1,39 @@ { "images" : [ { - "idiom" : "mac", "filename" : "DefaultBrowserWaterfox@1x.png", + "idiom" : "mac", "scale" : "1x" }, { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], "idiom" : "mac", + "scale" : "1x" + }, + { "filename" : "DefaultBrowserWaterfox@2x.png", + "idiom" : "mac", + "scale" : "2x" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "mac", "scale" : "2x" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 }, "properties" : { "template-rendering-intent" : "template" diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageWebKit.imageset/Contents.json b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageWebKit.imageset/Contents.json index 7227fc9..ed81701 100644 --- a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageWebKit.imageset/Contents.json +++ b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageWebKit.imageset/Contents.json @@ -1,21 +1,43 @@ { - "images" : [ + "images": [ { - "idiom" : "mac", - "filename" : "DefaultBrowserWebkit@1x.png", - "scale" : "1x" + "idiom": "mac", + "filename": "DefaultBrowserWebkit@1x.png", + "scale": "1x" }, { - "idiom" : "mac", - "filename" : "DefaultBrowserWebkit@2x.png", - "scale" : "2x" + "idiom": "mac", + "filename": "DefaultBrowserWebkit@2x.png", + "scale": "2x" + }, + { + "idiom": "mac", + "filename": "DefaultBrowserWebKit_Dark@1x.png", + "scale": "1x", + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ] + }, + { + "idiom": "mac", + "filename": "DefaultBrowserWebKit_Dark@2x.png", + "scale": "2x", + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ] } ], - "info" : { - "version" : 1, - "author" : "xcode" + "info": { + "version": 1, + "author": "xcode" }, - "properties" : { - "template-rendering-intent" : "template" + "properties": { + "template-rendering-intent": "template" } -} \ No newline at end of file +} diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageWebKit.imageset/DefaultBrowserWebKit_Dark@1x.png b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageWebKit.imageset/DefaultBrowserWebKit_Dark@1x.png new file mode 100644 index 0000000..b09195d Binary files /dev/null and b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageWebKit.imageset/DefaultBrowserWebKit_Dark@1x.png differ diff --git a/DefaultBrowser/Assets.xcassets/StatusBarButtonImageWebKit.imageset/DefaultBrowserWebKit_Dark@2x.png b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageWebKit.imageset/DefaultBrowserWebKit_Dark@2x.png new file mode 100644 index 0000000..e24b15b Binary files /dev/null and b/DefaultBrowser/Assets.xcassets/StatusBarButtonImageWebKit.imageset/DefaultBrowserWebKit_Dark@2x.png differ diff --git a/generate_dark_mode_assets.sh b/generate_dark_mode_assets.sh new file mode 100755 index 0000000..e4c7e8e --- /dev/null +++ b/generate_dark_mode_assets.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +imagesets=$( \ + ls DefaultBrowser/Assets.xcassets/ | \ + grep '^StatusBarButtonImage' | \ + grep -v 'Error\.' | \ + grep -v 'StatusBarButtonImage.imageset' \ +) + +for imageset in $imagesets +do + browser=${imageset%.*} + browser=${browser#StatusBarButtonImage} + name="DefaultBrowser${browser}" + light_1x_name="${name}@1x.png" + light_2x_name="${name}@2x.png" + dark_1x_name="${name}_Dark@1x.png" + dark_2x_name="${name}_Dark@2x.png" + # invert the browser icon part of the default browser icon + convert "DefaultBrowser/Assets.xcassets/$imageset/$light_1x_name" -region 14x8+1+7 -channel A -negate -transparent black "DefaultBrowser/Assets.xcassets/$imageset/$dark_1x_name" + # # invert the browser icon part of the default browser icon + convert "DefaultBrowser/Assets.xcassets/$imageset/$light_2x_name" -region 28x21+2+9 -channel A -negate -transparent black "DefaultBrowser/Assets.xcassets/$imageset/$dark_2x_name" + cp "DefaultBrowser/Assets.xcassets/$imageset/Contents.json" "DefaultBrowser/Assets.xcassets/$imageset/Contents.json.bak" + cat "DefaultBrowser/Assets.xcassets/$imageset/Contents.json.bak" | jq -r '.images += [{"idiom": "mac", "filename": "'$dark_1x_name'", "scale": "1x", "appearances": [{"appearance": "luminosity", value: "dark"}]}, {"idiom": "mac", "filename": "'$dark_2x_name'", "scale": "2x", "appearances": [{"appearance": "luminosity", value: "dark"}]}]' > "DefaultBrowser/Assets.xcassets/$imageset/Contents.json" +done +