GetGreyScale – Convert a color to greyscale

' Convert a color to greyscale' Example: Me.BackColor = GetGreyScale(Color.Red)Function GetGreyScale(ByVal col As Color) As Color    Dim greyValue As Integer = CType(col.R * 0.3 + col.G * 0.59 + col.B * 0.11, _        Integer)    Return Color.FromArgb(greyValue, greyValue, greyValue)End Function

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: