Compare RGB colors in c#

前端 未结 8 2045
予麋鹿
予麋鹿 2020-11-29 04:38

I\'m trying to find a way to compare two colors to find out how much they are alike. I can\'t seem to find any resources about the subject so I\'m hoping to get some pointer

8条回答
  •  庸人自扰
    2020-11-29 05:26

    There's an open-source .net library that lets you do this easily: https://github.com/hvalidi/ColorMine

    The most common method for comparing colors is CIE76:

    var a = new Rgb { R = 149, G = 13, B = 12 }
    var b = new Rgb { R = 255, G = 13, B = 12 }
    
    var deltaE = a.Compare(b,new Cie1976Comparison());
    

提交回复
热议问题