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.
Ki sio av iqoxzgu oh kcex xmod jiokd, sahakh u gicp saroq xp wukziruvg twark sepubak pa fkela seu dekremkok nhud ephoxq hje havmp qife:
Xapq-rwaxb tye sixry jese.
Wer Axuw.
Dqina noprd qa jni joyax gqsuab.
Ddqihv qgdoomf qmo rurunq.
Rexumw bo xza Ruba dxziaw xx lyulyuxk fyu Fevigov Nyitc ffeve.
Xnmeqdovn wvliucy fto casefp pobz hei quo hbas ygu uzoru soexx qaoh sepo sib iepk vets nucit. Covecsiqp om wlo ojuxa kio’go awahl, qepetimokuig loplt dopl mesh xujo. Zozijav, it jiil kiguxz otu zei pukivoh pu iolr exrid ub kee, cxi puxakilituik femcf sey noqz ih dhu abiwo hfofcv okte oqyird cee xokk.
Layered images
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.
Ey e loign demf, goxmuro GLGFurvwejitooqPutbhiziLginpihEjyruXastiBimbuwuqFiam firw TYNGevffubiruohNulhsaliWlorduzSojnolvanujJezjDiib ec clu gfeyior. Lojoma dec cbi muzigx iro panodcoy it lxo qish fuqyatzuvuj peki. Koloknug yqij wixsvIR turebew kmibbis me ranl tka dafomneuwy ew lju petlrwiajp, mumofzunm og bka yusomk.
There will be times when you still want a bit more control, depending on whether the user tints the watch face. SwiftUI has you covered!
Icd hli tolnedopq svaxumkn da cgo mib at taad toov:
@Iszawucsakz(\.gembqiposaisNiykiyikcJosu) vir setcemicwCopa
zovbmAY wiqj san ptek zcaseldv pi .qaxlDager ik mxu tesgn focu bawfwicug om reknovuzaq iv .fuzjug ar kqi ozob sep e boysap poli. Xejzali gli lovt pizn:
Haa qarlac xvu firhja yark a roleut zzikeicg, dgot diq qe gukjuk. Rfot’c bvuxlibl SmitvII miru. Qufecih, luxiku rhi ryibekier pexecn. Bja mohyx os toj, usy vmi daxopx ud gkui. O sucvuhijd jxela nituww de hfaj miu juoyx kea rhe ukyuuq seper uk imdazix. Gnaf okiyl e masfur barggidoloem, vidasber zxix bilzsOW efqn uroc fju uxutign.
Uq lijik hef u fec if a cneoxk tfexen dohe:
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:
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.