SKIASharp withAlpha method to apply transparency is changing colors

69 views
Skip to first unread message

Shuchi

unread,
Dec 8, 2022, 8:14:07 AM12/8/22
to skia-discuss
I need to apply Transparency to SKIA Paint object. I am using below line of code to achive it.
paint.Color = paint.Color.WithAlpha((byte)(0xFF * transparency));
I created a Windows Forms sample and a SKIASharp Blazor sample to run code on browser. 
I observed that Transparency works fine in Windows Forms app and renders colours correctly with alpha.
But in Web app, Transparency is not working as expected. It is changing original colours in display in chrome.
See difference in colors in screenshots attached. Please throw some light on how to get transparency work in web app.
winForm.pngWebApp.png

Ben Wagner

unread,
Dec 8, 2022, 11:21:32 AM12/8/22
to skia-d...@googlegroups.com
Note that this is a group for Skia and not SkiaSharp. SkiaSharp is a separate project at https://github.com/mono/SkiaSharp and you may want to report this issue there. Unfortunately, it appears that SkiaSharp is stuck on Skia m88, which is almost two years old and ~12000 commits behind tip of tree Skia (the https://github.com/mono/skia/commits/0c6ddc9e450c4a822ea10548b360e821ad97991e dependency looks a bit newer, but this is just a few updates to SkiaSharp's fork of Skia which is based on m88). As a result, it isn't always straight forward to determine if an issue like this is due to SkiaSharp or just the old version of Skia used by SkiaSharp.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/729d5aca-b02b-4013-89f7-e571ec25fe05n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages