I think it might be because it is based off which Display I have connected. When I do the same with google colour picker it prints similar values so I think the code is working as expected but your display/image compression is subtly changing the colours. I would not worry too much about it!
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: