How can I assign a custom color to a cell in Aspose Cells?

In the legacy (Excel Interop) code, this can be done to assign a custom color to a cell:

contractCell.Interior.Color = ColorTranslator.ToOle(Color.FromArgb(202, 134, 250));

Using Aspose Cells, I'm trying to find the corresponding way to do it. This code:

styleContractRow2.ForegroundColor = ColorTranslator.ToOle(Color.FromArgb(202, 134, 250));
styleContractRow2.Pattern = BackgroundType.Solid;

...does not compile, telling me, "Cannot implicitly convert type 'int' to 'System.Drawing.Color'"

So how can I assign a custom color in Aspose Cells?

Upvotes: 0

Views: 276

Answers (2)

shakeel
shakeel

Reputation: 1725

Please check the reply and sample code in your Aspose.Cells forum thread.

Note: I am working as Developer Evangelist at Aspose

Upvotes: 2

It seems as if the translation is unnecessary; this compiles:

styleContractRow2.ForegroundColor = Color.FromArgb(202, 134, 250);

Upvotes: 1

Related Questions