chrs1885 / Capable

Unified accessibility API for iOS, macOS, tvOS & watchOS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support caption color calculation for background images

chrs1885 opened this issue · comments

What kind of feature would you like to see?

Calculate high contrast text color for specific areas of a given background image.

How does it work in detail?

Get average color of the requested image area. Calculate the high contrast text color based on that color.

What does the API look like?

class func getTextColors(onBackgroundImage image: Image, imageArea: ImageArea = .full) -> Color? {

Any existing projects that do something similiar?