app icon color was different while i generate icons
pmrajani opened this issue ยท 27 comments
Here is my code:
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/images/app_logo.png"
adaptive_icon_background: "#ffffff"
It is generating slightly different color instead of my actual logo for app.
Yes same with me.
Admin can you please look at this?
It seems this is caused by an update to the image
dependency. After I changed the image
package version to 2.0.7 my icon color is correct.
You can change it by navigating to this package folder in pub_cache
I am having the same issue and change the image package version to 2.0.7 doesn't work
Having the same issue, the original color is
#EB6F93
The generated color is: #936FEB
@Inovactio you need to force the version to 2.0.7.
This is the current pubspec for this package
dependencies:
image: "^2.0.0"
You need to change "^2.0.0"
to "2.0.7"
@HelgeSverre yup that's because the image
package changed the position of ARGB.
From the version 2.0.8. changelog
- Use #AARRGGBB for colors instead of ##AABBGGRR, to be compatible with Flutter image class.
Thanks for the quick fix @skybur, that fixed the issue for now.
Thanks @skybur, perfect timing as I just hit this too!
To be explicit for anyone else following this, I edited ~/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.7.0/pubspec.yaml to read:
image: "2.0.7" # No ^! Specific version only!
and did a flutter packages get
then ran flutter packages pub run flutter_launcher_icons:main
again.
You can also just set the specific version in your pubspec.yaml
file, like so:
dev_dependencies:
image: 2.0.7 # <- Put this here
flutter_launcher_icons: "^0.7.0"
flutter_test:
sdk: flutter
flutter_icons:
android: true
ios: true
image_path: "assets/icon/app-icon.png"
adaptive_icon_background: "#EB6F93"
Thanks @HelgeSverre, that's a bit neater!
You can also just set the specific version in your
pubspec.yaml
file, like so:dev_dependencies: image: 2.0.7 # <- Put this here flutter_launcher_icons: "^0.7.0" flutter_test: sdk: flutter flutter_icons: android: true ios: true image_path: "assets/icon/app-icon.png" adaptive_icon_background: "#EB6F93"
Same issue, not working for me :(
image: "^2.0.7"
flutter_launcher_icons: ^0.7.0
flutter_icons:
ios: true
android: true
image_path_ios: "assets/launcher/icon.png"
image_path_android: "assets/launcher/icon.png"
adaptive_icon_background: "assets/launcher/background.png"
adaptive_icon_foreground: "assets/launcher/foreground.png"
@scarings You've specified image: "^2.0.7"
instead of image: "2.0.7
(Notice the ^)
Will this be fixed? Not everyone comes here to check this.
@Inovactio you need to force the version to 2.0.7.
This is the current pubspec for this packagedependencies: image: "^2.0.0"
You need to change
"^2.0.0"
to"2.0.7"
@HelgeSverre yup that's because the
image
package changed the position of ARGB.
From the version 2.0.8. changelog- Use #AARRGGBB for colors instead of ##AABBGGRR, to be compatible with Flutter image class.
Thank you! I was searching for a solution + explanation and you offered both, amazing.
I had this issue as well. Pinning the image dependency worked. Thanks.
You can also just set the specific version in your
pubspec.yaml
file, like so:dev_dependencies: image: 2.0.7 # <- Put this here flutter_launcher_icons: "^0.7.0" flutter_test: sdk: flutter flutter_icons: android: true ios: true image_path: "assets/icon/app-icon.png" adaptive_icon_background: "#EB6F93"
Worked
+1
v0.7.1 is now using a newer version of the image dependency so you will need to switch about the colors like describe in @skybur's post
Same problem with version "flutter_launcher_icons: ^0.7.2".
For example, in "adaptive_icon_foreground:" blue icon with background #1194F6 turns orange.
Sorry about the problems. Seems changing the color order caused more problems than good. The Image getBytes and fromBytes methods do let you specify the color order. For example, Image.fromBytes(canvas.width, canvas.height, imageData.data, format: Format.rgba)
and image.getBytes(format: Format.rgba)
will ensure the colors are encoded the way that seems to be expected by this package. I'll investigate what repercussions changing the default back will be.
I changed the default color order to the way it was before, released in version 2.1.3 of the image library.
Yep, just tried and the color is correct. Thanks @brendan-duncan
sarmayah imac$ flutter pub run flutter_launcher_icons:main
Android minSdkVersion = 16
Creating default icons Android
Overwriting the default Android launcher icon with a new icon
Creating adaptive icons Android
Overwriting default iOS launcher icon with new icon
I have this problem
dev_dependencies:
image: 2.0.7
flutter_widget_from_html_core: ^0.5.2
flutter_launcher_icons: "^0.7.0"
flutter_test:
sdk: flutter
flutter_icons:
#image_path_android: "assets/luncher.png"
#image_path_ios: "assets/luncher1.png"
image_path: "assets/luncher1.png"
android: true
ios: true
adaptive_icon_foreground: "assets/luncher1.png"
adaptive_icon_background: "assets/backgroundimg.png"