How can I get the color of an RGBA pixel pixel from a WKWebView?
I have a working solution for UIWebView, but I would like to use WKWebView. When I click on a point on the screen, I can get the color value in RGBA from the UIWebView, for example (0,0,0,0), when it is transparent or something like (0,76,0,23,0,34,1 ) when it is not transparent. WKWebView always returns (0,0,0,0) instead.
More details
I am working on an iOS application as WebView is the biggest ui element.
WebView has transparent areas so you can see the underlying UIView.
WebView should ignore strokes on transparent areas, and the original UIView should receive this event.
So I redefined the hitTest function:
My guess is that WKWebView has another CALayer or hidden UIView where it draws the actual web page.
ios objective-c pixel rgba wkwebview
Tassilo waldraff
source share