private void RenderColorPickerOverlay(object?sender, FrameRenderingEventArgs e) { if (_mustRenderOverlay) { _overlayOpacity += 0.2f; } else { _overlayOpacity -= 0.2f; } if (_overlayOpacity <= 0f) { _coreService.FrameRendering -= RenderColorPickerOverlay; return; } if (_overlayOpacity > 1f) { _overlayOpacity = 1f; } using SKPaint overlayPaint = new() { Color = new SKColor(0, 0, 0, (byte)(255 * _overlayOpacity)) }; overlayPaint.Color = _overlayColor.WithAlpha((byte)(_overlayColor.Alpha * _overlayOpacity)); e.Canvas.DrawRect(0, 0, e.Canvas.LocalClipBounds.Width, e.Canvas.LocalClipBounds.Height, overlayPaint); } }
protected virtual void OnFrameRendering(FrameRenderingEventArgs e) { FrameRendering?.Invoke(this, e); }
private void CoreServiceOnFrameRendering(object sender, FrameRenderingEventArgs e) { CurrentFps = Math.Round(1.0 / e.DeltaTime, 2); }