~/talk

Extending UIColor to Support Custom Styling

Talkat try! Swift NYC 2019 · 2019-09-09..09-10· [accessibility]

Slides and playground show concrete code that extends UIColor with methods to extract HSB brightness, compute WCAG contrast ratios, and compute the adjusted brightness needed to hit a minimum contrast ratio of 7. Code includes a convenience that returns a new UIColor with adjusted brightness so foregrounds meet accessibility, and notes using iOS 13 dynamic colors and resolvedColor(with:) when converting to CGColor. Tests show low-contrast cases raised to the target ratio.

AI-written summary · about

  1. 0:00Start
  2. 2:23Overview
  3. 3:11Definition of What a Color Is
  4. 4:34Color Space
  5. 5:04Hsv Color Space
  6. 5:36Saturation
  7. 6:34Brightness
  8. 7:45Hsv Color Space
  9. 8:50Contrast
  10. 9:18Wcag Standards
  11. 10:05Contrast Ratio
  12. 10:26Custom Coloring
  13. 10:57Examples
  14. 11:52Dark Mode
  15. 13:03High Contrast Mode
  16. 13:35Dynamic Semantic Colors
  17. 13:53Label
  18. 14:16Create Custom Dynamic Colors
  19. 14:46Custom Imagery
  20. 17:14Color Collisions and How To Handle Them Client-Side
  21. 17:47Predefined Palette
  22. 19:41Calculate the Contrast Ratio
  23. 22:55Recap
  24. 23:32Code Examples
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.