十六进制颜色值排序 [英] Sort Hex Color Values

查看:58
本文介绍了十六进制颜色值排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个与产品相关的色表.十六进制的colors值保存在nvarchar字段中.
在产品部分,我有一个下拉列表,用于指定产品的颜色.
所以我需要将这些颜色从浅到深进行排序...
我正在使用MVC 3.0并编写C#代码.

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.

推荐答案

您要获取其强度,因此请从RGB转换为HSV.有关更多详细信息,请参见这篇文章.

You want to get their intensity, so convert from RGB to HSV. See this post for more details.

这篇关于十六进制颜色值排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆