Apple has filed a patent application for an Apple Pencil that would include optical sensors for sampling the colors and texture of an item.