Closed JonLz closed 3 years ago
Thanks for the PR! I will check it by the end of the week.
Thank you for reviewing the PR. I've added your suggestions.
Rebased from the latest master and updated the README conflicts.
Thanks for your comments, I think the processing code is cleaner now. Please take a look at the latest commit. Thanks.
If I remove a dark illustration I get the following error:
Error: ❌ Asset with name img_zero_error have different description. In dark theme «», in light theme «android»
Open AssetProcessor.swift
file and find 4. descriptionMismatch
string. When there is no dark variant of image dark
is equal to nil
and error occurs.
if let platform = asset.platform {
let dark = darkSet.first(where: { $0.name == asset.name })
if dark?.platform != platform { // <<<<<<—————— Bug here
errors.all.append(...)
}
I've fixed this issue. You can copy the code below.
// 4. descriptionMismatch
lightSet.forEach { asset in
if
let platform = asset.platform,
let dark = darkSet.first(where: { $0.name == asset.name }),
dark.platform != platform {
let error = AssetsValidatorError.descriptionMismatch(
assetName: asset.name,
light: platform.rawValue,
dark: dark.platform?.rawValue ?? "")
errors.all.append(error)
}
}
@JonLz Thanks for the PR! Great job! I will publish a new version by the end of the week.
Resolves #68
Let me know if there is any fix required for android. I'm not as familiar with how the color specifications work on that platform. I think it can now generate a dark colors file with less values than the light colors file. Is that an issue? For the time being, I've added in the same warning used in iOS. Similarly, I was not able to test illustration exports but let me know if you see any issues there.