function convertHexToRGB(color) { if (color.length === 4) { let extendedColor = "#" for (let i = 1; i < color.length; i++) { extendedColor += color.charAt(i) + color.charAt(i) } …
Introduction Why an article on "colors"? It's the same question I asked myself before writing this series. The fact is, in .NET, there are only two color formats that can be used: the RGB color model and the HSB color model. Those two are encaps…
1. Color类 µ 公共静态属性:共13个静态属性,分别代表13种不同的颜色常量. µ 构造函数 ü public Color(int r,int g,int b):以整数形式给出红.绿.蓝三个分量的值,每个分量的范围:0~255 ü public Color(float r,float g,float b):r.g.b均为单精度浮点数.取值范围为0.0f~1.0f ü public Color(int rgb):rgb的16~23位:红色分量:0~7位:蓝色分量,8~15位:绿色分量. 2…