Convert color int value To Html Color - CSharp System.Drawing

CSharp examples for System.Drawing:Color Convert

Description

Convert color int value To Html Color

Demo Code


using System.Drawing;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/* w ww. j a va 2s . com*/

public class Main{
        public static string ToHtmlColor(int value)
        {
            return "#" + (value & 0xffffff).ToString("X6");
        }
}

Related Tutorials