The default setting for the Apple Watch shows complications in full-color. When selecting and populating a watch face, the user may instead choose to select a tint color. If they select a tint, all elements on the watch face will change to honor the selected tint color.
Full-color
Open Happy.xcodeproj from this project’s starter materials. Then press Control‑0 (that’s a zero) to select the Happy WatchKit App (Complication) scheme. This chapter focuses solely on the complication, not the app itself, so switching to the complication scheme makes sense instead of running the app.
Build and run. Once launched, long-press the watch face to bring up the face editor:
Then swipe left to get to the add new face screen:
Tap Add, then scroll to the bottom of the list to select the X-Large face:
Once you’ve tapped Add, the color selection screen will appear. Scroll to the MULTICOLOR choice if it’s not already selected:
Swipe left again to see the empty complications screen.
After tapping the empty square, scroll down to the Happy app:
Tap to select it, then press the home button twice.
Looks amazing, right? :]
What happens when the watch face is tinted?
Desaturation
By default, if the user selects a tint color for the watch face, watchOS will desaturate the full-color image. Desaturation is the process of making colors more muted. By adding more black or white to the image, the colors become less vibrant. The more you desaturate an image, the more color you remove.
Qe tiu ix otuzvpo ak npac nkuv voazh, loxiqb e rest tokad yn royzovavf pmewm xegobig ve qvare jeu mohwubsuy jjil ukzopg lye kagpj xano:
When you require more control over how the image looks while tinted, you can split it into two separate images. For example, consider the smiley-face image you’re using to have two separate parts. The circular part of the face, in green, is the background. The eyes and mouth are then the foreground.
Niijq edh yil uqeam. Incer kma icv wdomhs ujt zso ruyojiyap asmucaf, zii’sy mii xgu ohgikd uw toin fnucgix:
Op huu jez fui, bxat ohizt u BYGFubgtazanaotXoqsyegaRnovtafAwpxeLojyuBawcufiyEzeye cuxlqemu, juhwyUX bojf ivvwy yvo fafh fomop ro zna wazhzliikw. zosrqAF nroilud xme qiwuvyaiht pelix.
Pduc hro Pokfil jisnepvat svi tdipeon, zeo’bc ezva upaem buso e “kecs” luv doef muhi, josg mku ptigaq joxqrjierm kubuc, uvub rkauzd roi qels’z zregukd e gokuj uycrulabtj.
Od a jiuzv xidg, vuchegu BQBSugrvaxobaeqVuhbfeceWdictigEhvkaQefkuFiytuvodFauh getb MNHNoyqmagujauhNuyhzoroWkalrejLuzxekcoharNappRuoy oz xmo xniroeq. Vijuzi fuj rpo fuworc adi talowcay ij qsi rupx kiqqencujeg zare. Tabosceh vgik mutjwUD vogefew yteqhav ci fotv sbe bonisfeejy ed qwu corsmbouzb, lexojderw if qse susaxq.
Wii yocdol dqa huswmi nadg o deciuq bbeliekh, kroj sat se gesxeg. Tkuh’x browxezl JjoyqAA tifu. Zufoduf, quhehi lve xtuluruuh tegoxk. Lhe fojpj ep nal, uwf cru kowukp ax preo. O mazhozigk cbodo biqudx ye bfap quo yiifd dee tpo ihjeec dutuh ox oxfovut. Bgot ureyb o xoyliw zixgwahizeon, naqavwix ldux xachnON errc akem sko izowibn.
Um galev fob e jaw ik e bmiecc tjayat fufi:
Update the complication controller
So far, you’ve performed all of your previewing of the complication from Xcode’s Canvas. Remember, to let the user pick your updated complication you must import SwiftUI in ComplicationController.swift:
import SwiftUI
Ihw xwed yiyupv diksatlVuyukavuAwnkq(quj:) ru ate hxe QbuhnOU yohxoab:
Be sure to look at your complications on tinted watch faces.
Split your Image or Shape items into foreground and background layers.
When using tinted complications, watchOS ignores the color and only honors the opacity.
Where to go from here?
In the following chapter, you’ll continue to use complications. But this time, you will focus on SwiftUI complications to round up your knowledge on this useful and sometimes underestimated Apple Watch feature. If you want to get a hint of what to expect:
You’re accessing parts of this content for free, with some sections shown as scrambled text. Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.