Csharp/CSharp Tutorial/2D/Color

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

Create Color from R, G, B value

using System;
using System.Drawing;
using System.Windows.Forms;
public class MainClass{
   public static void Main(){
    Color currColor = Color.FromArgb(123, 123, 123);
    
    Console.WriteLine(currColor.ToString());    
   }
}
Color [A=255, R=123, G=123, B=123]

Create Color object from string

using System;
using System.Drawing;
using System.Collections;
using System.ruponentModel;
using System.Windows.Forms;
using System.Data;

public class MainClass{
   public static void Main(){
    Color currColor = Color.FromName("Blue");
   }
}