问题
I have a color table related to products. The value of colors which is a hexadecimal is saved in a nvarchar field.
In the products section I have a dropdown List for colors of a specified product.
So I need to sort these colors from lighter to darker...
I'm using MVC 3.0 and writting C# code.
回答1:
You want to get their intensity, so convert from RGB to HSV. See this post for more details.
来源:https://stackoverflow.com/questions/7434347/sort-hex-color-values