Пропустить навигацию
Here’s a ‘glow-in-the-dark’ effect achieved by reading the device’s ambient light sensor and…
0:00 / 0:20

Here’s a ‘glow-in-the-dark’ effect achieved by reading the device’s ambient light sensor and…

Alex Widua

@alexwidua17 тыс. подписчиков

Открыть в X
5 616 отметок «Нравится»СкачатьОригинальный пост

547 495 просмотров

Here’s a ‘glow-in-the-dark’ effect achieved by reading the device’s ambient light sensor and partially dimming the UI 💡

10 комментариев

Комментарии из оригинального поста в X (Twitter)

  • Фото профиля Alex Widua

    @alexwidua

    Played around with dynamic backgrounds too. They’re not so much different from time-based day/night backgrounds but the gradual changes make it pretty interesting.

    368 отметок «Нравится»

  • Фото профиля Alex Widua

    @alexwidua

    The demos are not actually reading the ambient sensor though (couldn’t get SensorKit permissions to work). Instead the luminosity is calculated using the device’s camera exposure. I grabbed the snippet from SO user AnuradhaH (

    68 отметок «Нравится»

  • Фото профиля Alex Widua

    @alexwidua

    Having a lot of fun with these little SwiftUI explos recently. I’m learning a lot by just taking apart and remixing @philipcdavis’ and @jsngr’s prototypes — totally worth to check out Philip’s prototyping kit and Jordan’s repos

    49 отметок «Нравится»

  • Фото профиля Ryan McLeod

    @warpling

    Ugh I wish the actual light sensor was available to us, still really cool!!

    8 отметок «Нравится»

  • Фото профиля Alex Widua

    @alexwidua

    yeah, would be fun to build some web prototypes with it :-) Yesterday I learnt that there used to be a DeviceLight API many years ago ( Never made it past the experimental feature flag though...

    4 отметки «Нравится»

  • Фото профиля Duy Luong

    @duyluongdesign

    Dang 🤩! You really triggers me to learn Swift/SwiftUI again. Was it done in SwiftUI?

    5 отметок «Нравится»

  • Фото профиля Alex Widua

    @alexwidua

    yup, SwiftUI :-) The code is up on GitHub

    13 отметок «Нравится»

  • Фото профиля alexsm.eth ⠕🍌

    @_alexsm_

    Do you think apple would allow this though? Seems like an accessibility dark pattern 🧐

    1 отметка «Нравится»

  • Фото профиля Prerna Singh

    @prerna_singh587

    @AdityaP11966861

    1 отметка «Нравится»

  • Фото профиля FLO.CHAU

    @FloChau

    @charlesbail_

    1 отметка «Нравится»