Color(颜色)

This class can be used to convert color values

// Import the module
import { Color } from 'easy-util-tools'
//Instantiate the class
let color = new Color(255, 0, 0)
/**
 * 通道颜色,这个属性新增于1.0.3版本,这个属性只读
 * Channel color, this property was added in version 1.0.3, this property is read-only
 */
let channel = color.channel;
/**
* 十六进制颜色值,这个属性新增于1.0.3版本,这个属性只读
* Hexadecimal color value, this property was added in version 1.0.3, this property is read-only
*/
let hex = color.hex;
/**
* rgb颜色,这个属性新增于1.0.3版本,这个属性只读
* rgb color, this attribute has been added in version 1.0.3, this property is read-only
*/
let rgb = color.rgb
/**
* 获取通道颜色 此方法已于1.0.8版本废弃,可以直接使用channel属性获取
* Get channel color This method will be deprecated in the next minor version and can be obtained directly using the channel property
*/
let channelColor = color.getChannelColor()

Last updated