Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app icon color was different while i generate icons #98

Closed
pmrajani opened this issue May 9, 2019 · 27 comments
Closed

app icon color was different while i generate icons #98

pmrajani opened this issue May 9, 2019 · 27 comments

Comments

@pmrajani
Copy link

pmrajani commented May 9, 2019

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.

@inceptusp
Copy link

I am having the same issue, look the attached files...
Original: Original
Generated: Generated

@pmrajani
Copy link
Author

Yes same with me.
Admin can you please look at this?

@skybur
Copy link

skybur commented May 10, 2019

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

@Inovactio
Copy link

I am having the same issue and change the image package version to 2.0.7 doesn't work

@HelgeSverre
Copy link

Having the same issue, the original color is
#EB6F93
The generated color is: #936FEB

@skybur
Copy link

skybur commented May 10, 2019

@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.

@HelgeSverre
Copy link

Thanks for the quick fix @skybur, that fixed the issue for now.

@mykdavies
Copy link

mykdavies commented May 10, 2019

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.

@HelgeSverre
Copy link

HelgeSverre commented May 10, 2019

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"


@mykdavies
Copy link

Thanks @HelgeSverre, that's a bit neater!

JuanuMusic added a commit to JuanuMusic/flutter_launcher_icons that referenced this issue May 11, 2019
@scarings
Copy link

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"

@HelgeSverre
Copy link

@scarings You've specified image: "^2.0.7" instead of image: "2.0.7 (Notice the ^)

@florix91
Copy link

Will this be fixed? Not everyone comes here to check this.

@giovanni-orciuolo
Copy link

giovanni-orciuolo commented May 17, 2019

@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.

Thank you! I was searching for a solution + explanation and you offered both, amazing.

@TheBestMoshe
Copy link

I had this issue as well. Pinning the image dependency worked. Thanks.

@surveshoeb
Copy link

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

@sante85
Copy link

sante85 commented May 21, 2019

+1

@MarkOSullivan94
Copy link
Collaborator

MarkOSullivan94 commented May 23, 2019

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

@uxartur
Copy link

uxartur commented May 26, 2019

Same problem with version "flutter_launcher_icons: ^0.7.2".

For example, in "adaptive_icon_foreground:" blue icon with background #1194F6 turns orange.

@MarkOSullivan94
Copy link
Collaborator

@uxartur check out @skybur's post above which should help, the issue is related the image package update.

@brendan-duncan
Copy link

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.

@ilorivero
Copy link

ilorivero commented May 26, 2019

I have the same issue here. The image below shows the iOS iconset. The only correct image is the last one (the blue background one). The others have inverted colors.

image

On Android, same issue using separete foreground and background images:

image

Thanks for any help!

@c0h1b4
Copy link

c0h1b4 commented May 27, 2019

pubspec.yaml:

flutter_icons:
android: true
ios: true
image_path: "assets/icon/app-icon.png"

Didn't even use adaptive_icon_background option, but with adaptive_icon_background #ffffff, get same result.

image: ^2.1.1
and
flutter_launcher_icons: "^0.7.2"

Original image:
icon

Generated image:
ic_launcher

@brendan-duncan
Copy link

I changed the default color order to the way it was before, released in version 2.1.3 of the image library.

@skybur
Copy link

skybur commented May 28, 2019

Yep, just tried and the color is correct. Thanks @brendan-duncan

@MohammadOsmankhan
Copy link

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

@MohammadOsmankhan
Copy link

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests