Click or drag to resize
Ab4d.SharpEngine logo

Extensions Class

Extensions class provides extension methods to convert Avalonia types to SharpEngine types and vice versa.
Inheritance Hierarchy
SystemObject
  Ab4d.SharpEngine.AvaloniaUIExtensions

Namespace: Ab4d.SharpEngine.AvaloniaUI
Assembly: Ab4d.SharpEngine.AvaloniaUI (in Ab4d.SharpEngine.AvaloniaUI.dll) Version: 1.0.8740+dd919213ce98c470a123b140574ba91ba31d337e
Syntax
C#
public static class Extensions

The Extensions type exposes the following members.

Methods
 NameDescription
Public Extension MethodIsEmpty Returns true when Width or Height are zero.
Public Extension MethodSaturate(Color3) Ensures that the color components are within 0 and 1 - if smaller than 0 than the value is set to 0; if bigger than 1 the value is set to 1. This is the same as saturate function in HLSL.
Public Extension MethodSaturate(Color4) Ensures that the color components are within 0 and 1 - if smaller than 0 than the value is set to 0; if bigger than 1 the value is set to 1. This is the same as saturate function in HLSL.
Public Extension MethodToAvaloniaColor(Color3) Converts SharpEngine's Color3 to Avalonia color
Public Extension MethodToAvaloniaColor(Color4) Converts SharpEngine's Color4 to Avalonia color
Public Extension MethodToColor3 Converts Avalonia Color to SharpEngine's Color3
Public Extension MethodToColor4 Converts Avalonia Color to SharpEngine's Color4
Public Extension MethodToPremultipliedColor3(Color) Converts Avalonia Color to premultipled SharpEngine's Color3 (premultipled color is color where R, G and B color values are multiplied with alpha value)
Public Extension MethodToPremultipliedColor3(Color, Single) Converts Avalonia Color to premultipled SharpEngine's Color3 (premultipled color is color where R, G and B color values are multiplied with alpha value)
Public Extension MethodToPremultipliedColor4 Converts Avalonia Color to premultipled SharpEngine's Color4 (premultipled color is color where R, G and B color values are multiplied with alpha value)
Top
See Also