Skip to content

Instantly share code, notes, and snippets.

@binho
Last active September 23, 2016 12:15
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save binho/51fe8a9b5bef493f94fb352096a12d86 to your computer and use it in GitHub Desktop.
Save binho/51fe8a9b5bef493f94fb352096a12d86 to your computer and use it in GitHub Desktop.
#!/bin/bash
DIRECTORY=$1
echo "------------------------------"
echo "Passed Resources with xcassets folder argument is <$DIRECTORY>"
echo "------------------------------"
XC_ASSETS="$(find "$DIRECTORY" -name '*.xcassets')"
for xcasset in $XC_ASSETS; do
echo "-- 📦 XC Asset: $xcasset"
IMAGE_SETS="$(find "$xcasset" -name '*.imageset')"
for imageset in $IMAGE_SETS; do
echo "---- 🌠 Image set: $imageset"
FILES="$(find "$imageset" -name '*.png')"
for file in $FILES; do
echo "-------- ✅ PNG FILE: $file"
sips -m "/System/Library/Colorsync/Profiles/sRGB Profile.icc" $file --out $file
done
done
done
echo "------------------------------"
echo "🎉 Done"
echo "------------------------------"
./fix-image-color-ios8.sh /path/to/project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment