目录
当前位置: 首页 > 文档资料 > Snap.svg 英文文档 >

Snap.color(clr)

优质
小牛编辑
123浏览
2023-12-01

Parses the color string and returns an object featuring the color's component values

Parameters

  1. clrstringcolor string in one of the supportedformats (seeSnap.getRGB)

Returns: object Combined RGB/HSB object in the following format:

  1. {
    1. r numberred,
    2. g numbergreen,
    3. b numberblue,
    4. hex stringcolor in HTML/CSS format: #••••••,
    5. error booleantrue if string can't be parsed,
    6. h numberhue,
    7. s numbersaturation,
    8. v numbervalue (brightness),
    9. l numberlightness
  2. }