Swiftpack.co - Sherlouk/AccessibilitySnapshotColorBlindness as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Sherlouk.
Sherlouk/AccessibilitySnapshotColorBlindness 1.0.0
Colour blindness simulation and testing for iOS
⭐️ 74
🕓 2 years ago
iOS
.package(url: "https://github.com/Sherlouk/AccessibilitySnapshotColorBlindness.git", from: "1.0.0")

Color Deficiency Snapshot Tests

This package makes it easier for you to understand the implications of your app's design on users with various types of color blindness.

It adds functionality to SnapshotTesting which allows you to generate images of your UIViews, UIViewControllers and UIImages with multiple color blindness filters over the top simulating what it looks like to users with different types of vision deficiencies.

Image demonstrating the different types of colour blindness

Usage

// 1. Import
import AccessibilitySnapshotColorBlindness

// 2. Create UIView, UIViewController or UIImage.
let systemUnderTest = // ... your code

// 3. Assert Snapshot
assertSnapshot(matching: image, as: .image_colourBlindness(type: .protanopia))

You may wish to use MatrixTypes.allCases to snapshot all variations of your view. You can see an example of this in our tests.

Shoutouts

GitHub

link
Stars: 74
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Initial Release
2 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics