react-native-view-shot icon indicating copy to clipboard operation
react-native-view-shot copied to clipboard

(Web) Add backgroundColor to captureRef

Open burakgormek opened this issue 2 years ago • 1 comments

Html2canvas have backgroundColor option which is sets background color of captured image. Default value is "#FFFFFF" so if you capture image on web, there will be a white border on bottom. We need to add option to set html2canvas background. This pr does this.

I also set default value to null which is corresponds "transparent" on html2canvas side. This matches the native behavior better(iOS, Android).

Reproduce:

<View ref={viewRef} style={{ backgroundColor: "red", width: 50 }}>Test</View>

Before: image After { backgroundColor: "red" }: image

burakgormek avatar Jul 06 '23 12:07 burakgormek

Maybe we can get color from the ref view

burakgormek avatar Sep 29 '23 12:09 burakgormek