A new patent filed by Apple details a stylus, likely an Apple Pencil, that contains an embedded color sensor. Located in either the back end or tip of the Pencil, the color sensor would be able to scan and copy the color from real-world objects. While the patent looks interesting, it is not yet known whether or not Apple will actually use it in future products.
https://www.notebookcheck.net/Future-Apple-Pencil-may-allow-users-to-copy-colors-from-real-world-objects-thanks-to-new-patent.482328.0.html