Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

system.drawing.color

How can I assign a color to a font in EPPlus?

January 3, 2024 by Tarik

It’s safe to assume Style.Fill.BackgroundColor and Style.Font.Color are both of type ExcelColor, so just use the same SetColor() method you used to set the background color. rowRngprogramParamsRange.Style.Font.Color.SetColor(Color.Red);

Categories c# Tags c++, epplus, epplus-4, excel-2007, system.drawing.color Leave a comment

System.Drawing.Brush from System.Drawing.Color

August 30, 2023 by Tarik

Use the SolidBrush class: using (SolidBrush brush = new SolidBrush(yourColor)) { // … }

Categories c# Tags c++, printdocument, system.drawing, system.drawing.color, winforms Leave a comment

Is there an online example of all the colours in System.Drawing.Color?

June 7, 2023 by Tarik

From here: The following image shows the color of each predefined brush, its name, and its hexadecimal value. May as well have the details right here on SO:

Categories c# Tags c++, system.drawing.color, user-interface Leave a comment

How do I invert a colour?

May 25, 2023 by Tarik

It depends on what do you mean by “inverting” a color Your code provides a “negative” color. Are you looking for transform red in cyan, green in purple, blue in yellow (and so on) ? If so, you need to convert your RGB color in HSV mode (you will find here to make the transformation). … Read more

Categories c# Tags .net, c++, colors, system.drawing.color Leave a comment

Set System.Drawing.Color values

February 1, 2023 by Tarik

You could create a color using the static FromArgb method: Color redColor = Color.FromArgb(255, 0, 0); You can also specify the alpha using the following overload.

Categories c# Tags .net, c++, colors, immutability, system.drawing.color Leave a comment

How to create a System.Drawing.Color from its hexadecimal RGB string?

January 24, 2023 by Tarik

ColorTranslator.FromHtml(“#FF00FF”);

Categories .net Tags .net, colors, hex, parsing, system.drawing.color Leave a comment

Convert System.Drawing.Color to RGB and Hex Value

November 20, 2022 by Tarik

I’m failing to see the problem here. The code looks good to me. The only thing I can think of is that the try/catch blocks are redundant — Color is a struct and R, G, and B are bytes, so c can’t be null and c.R.ToString(), c.G.ToString(), and c.B.ToString() can’t actually fail (the only way … Read more

Categories c# Tags asp.net, c++, rgb, system.drawing.color Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa