RGB CMYK Color C#

RGB color model is an additive color model while the CMYK is a subtractive color model which is also known as process color. In certain use cases, you may want to convert RGB color to CMYK color space or CMYK to RGB color model. In accordance with such scenarios, this article explains how to convert RGB to CMYK and CMYK to RGB programmatically in C#.

RGB and CMYK Color Space Conversion – C# API Configuration

Aspose.SVG for .NET supports parsing or converting different color spaces like HSV, CMYK, RGB, etc. Simply access the API by downloading its reference DLL files from the Downloads section, or use the NuGet installation command below:

PM> Install-Package Aspose.SVG

Convert RGB to CMYK Color Code in C#

You need to follow the steps below to convert an RGB color code to CMYK format:

  1. Parse the RGB color value.
  2. Convert RGB to CMYK color model.
  3. Print the output CMYK color code.

The following code sample elaborates on how to convert RGB to CMYK color space programmatically in C#:

Convert CMYK to RGB Color Code in C#

You can easily convert a CMYK color code to RGB format with the following steps:

  1. Parse the input CMYK color code.
  2. Convert the CMYK color to RGB color format.
  3. Print the converted color values.

The code snippet below shows how to convert a CMYK color code to RGB color space programmatically in C#:

Get Free API License

You can request a free temporary license to evaluate the API to its full capacity.

Conclusion

In this article, you have understood how to convert RGB color code to CMYK color value, as well as how to convert a CMYK color value to RGB format programmatically in C#. Furthermore, you can take a look at various other chapters in the documentation section to learn various other features offered by the API. If you want to raise any concern or query, please write to us at forum.

See Also