> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Class OperationAPIService

Namespace: [VM.API.Post.Operations](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r1/lib/VM.API.Post.Operations)\
Assembly: VM.API.Post.Operations.dll

A utility class that provides methods to convert string values to specific types.

```csharp theme={null}
public static class OperationAPIService
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ←
[OperationAPIService](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r1/lib/VM.API.Post.Operations.OperationAPIService.md)

## Methods

### GetColorFrameRGB(int, int, int)

Converts the specified RGB values into a Color object.

```csharp theme={null}
public static Color GetColorFrameRGB(int r, int g, int b)
```

#### Parameters

`r` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The red component of the color, ranging from 0 to 255.

`g` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The green component of the color, ranging from 0 to 255.

`b` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The blue component of the color, ranging from 0 to 255.

#### Returns

[Color](https://learn.microsoft.com/dotnet/api/system.windows.media.color)

A Color object representing the color defined by the specified RGB values.

#### Examples

The following example demonstrates how to use the `GetColorFromHexCode` method:

```csharp theme={null}
color = OperationAPIService.GetColorFrameRGB(255, 255, 255);
```

#### Remarks

This method takes integer values for the red, green, and blue components and converts them into a Color. Each parameter should be within the range of 0 to 255 to ensure valid color representation.

### GetColorFromHexCode(string)

Converts a hex color code to a Color.

```csharp theme={null}
public static Color GetColorFromHexCode(string color)
```

#### Parameters

`color` [string](https://learn.microsoft.com/dotnet/api/system.string)

The hex color code string to be converted.

#### Returns

[Color](https://learn.microsoft.com/dotnet/api/system.windows.media.color)

A Color that represents the converted color.

#### Examples

The following example demonstrates how to use the `GetColorFromHexCode` method:

```csharp theme={null}
color = OperationAPIService.GetColorFromHexCode("#FF1D2C35");
```

#### Remarks

This method converts a hex color code (e.g., "#FF5733") to a Color.

### GetFontFaceFromString(string)

Converts a font face string to a FontFamily.

```csharp theme={null}
public static FontFamily GetFontFaceFromString(string fontface)
```

#### Parameters

`fontface` [string](https://learn.microsoft.com/dotnet/api/system.string)

The font face string to be converted.

#### Returns

[FontFamily](https://learn.microsoft.com/dotnet/api/system.windows.media.fontfamily)

A FontFamily that represents the converted font face.

#### Examples

The following example demonstrates how to use the `GetFontFaceFromString` method:

```csharp theme={null}
fontface = OperationAPIService.GetFontFaceFromString("Arial");
```

#### Remarks

This method converts a font face string (e.g., "Arial") to a FontFamily.

### GetFontStyleFromString(string)

Converts a font style string to a FontStyle.

```csharp theme={null}
public static FontStyle GetFontStyleFromString(string fontstyle)
```

#### Parameters

`fontstyle` [string](https://learn.microsoft.com/dotnet/api/system.string)

The font style string to be converted (e.g., "Normal", "Italic", "Oblique").

#### Returns

[FontStyle](https://learn.microsoft.com/dotnet/api/system.windows.fontstyle)

A FontStyle that represents the converted font style.

#### Examples

The following example demonstrates how to use the `GetFontStyleFromString` method:

```csharp theme={null}
fontstyle = OperationAPIService.GetFontStyleFromString("Normal");
```

#### Remarks

This method converts a font style string (e.g., "Normal", "Italic", "Oblique") to a FontStyle.

### GetFontWeightFromString(string)

Converts a font weight string to a FontWeight.

```csharp theme={null}
public static FontWeight GetFontWeightFromString(string fontweight)
```

#### Parameters

`fontweight` [string](https://learn.microsoft.com/dotnet/api/system.string)

The font weight string to be converted (e.g., "Normal", "Bold", "Thin").

#### Returns

[FontWeight](https://learn.microsoft.com/dotnet/api/system.windows.fontweight)

A FontWeight that represents the converted font weight.

#### Examples

The following example demonstrates how to use the `GetFontWeightFromString` method:

```csharp theme={null}
fontweight = OperationAPIService.GetFontWeightFromString("Normal");
```

#### Remarks

This method converts a font weight string (e.g., "Normal", "Bold", "Thin") to a FontWeight.
