blob: bc9e06a8cb0837abd634ab23d1c45ee82de56d3f [file] [log] [blame]
Tests that the displayed string for colors correctly handles clipped CSS values and RGB percentages.
Running: testColors
color: red
simple: true
original: red
nickname: red
hex: #ff0000
shorthex: #f00
hexa: #ff0000ff
shorthexa: #f00f
rgb: rgb(255, 0, 0)
hsl: hsl(0, 100%, 50%)
color: #F00
simple: true
original: #F00
nickname: red
hex: #ff0000
shorthex: #F00
hexa: #ff0000ff
shorthexa: #f00f
rgb: rgb(255, 0, 0)
hsl: hsl(0, 100%, 50%)
color: #F00F
simple: true
original: #F00F
nickname: red
hex: #ff0000
shorthex: #f00
hexa: #ff0000ff
shorthexa: #F00F
rgb: rgb(255, 0, 0)
hsl: hsl(0, 100%, 50%)
color: #FF0000
simple: true
original: #FF0000
nickname: red
hex: #FF0000
shorthex: #f00
hexa: #ff0000ff
shorthexa: #f00f
rgb: rgb(255, 0, 0)
hsl: hsl(0, 100%, 50%)
color: #FF0000FF
simple: true
original: #FF0000FF
nickname: red
hex: #ff0000
shorthex: #f00
hexa: #FF0000FF
shorthexa: #f00f
rgb: rgb(255, 0, 0)
hsl: hsl(0, 100%, 50%)
color: rgb(255,0,0)
simple: true
original: rgb(255,0,0)
nickname: red
hex: #ff0000
shorthex: #f00
hexa: #ff0000ff
shorthexa: #f00f
rgb: rgb(255,0,0)
hsl: hsl(0, 100%, 50%)
color: rgb(300,0,0)
simple: true
original: rgb(300,0,0)
nickname: red
hex: #ff0000
shorthex: #f00
hexa: #ff0000ff
shorthexa: #f00f
rgb: rgb(255, 0, 0)
hsl: hsl(0, 100%, 50%)
color: rgb(255,-10,0)
simple: true
original: rgb(255,-10,0)
nickname: red
hex: #ff0000
shorthex: #f00
hexa: #ff0000ff
shorthexa: #f00f
rgb: rgb(255, 0, 0)
hsl: hsl(0, 100%, 50%)
color: rgb(110%, 0%, 0%)
simple: true
original: rgb(110%, 0%, 0%)
nickname: red
hex: #ff0000
shorthex: #f00
hexa: #ff0000ff
shorthexa: #f00f
rgb: rgb(255, 0, 0)
hsl: hsl(0, 100%, 50%)
color: rgba(0,0,0,0.5)
simple: false
original: rgba(0,0,0,0.5)
hexa: #00000080
shorthexa: null
rgb: null
rgba: rgba(0,0,0,0.5)
hsl: null
hsla: hsla(0, 0%, 0%, 0.5)
color: hsl(-120, 100%, 50%)
simple: true
original: hsl(-120, 100%, 50%)
nickname: blue
hex: #0000ff
shorthex: #00f
hexa: #0000ffff
shorthexa: #00ff
rgb: rgb(0, 0, 255)
hsl: hsl(-120, 100%, 50%)
color: hsl(-120, 200%, 200%)
simple: true
original: hsl(-120, 200%, 200%)
nickname: white
hex: #ffffff
shorthex: #fff
hexa: #ffffffff
shorthexa: #ffff
rgb: rgb(255, 255, 255)
hsl: hsl(-120, 200%, 200%)
color: hsl(-120, -200%, -200%)
simple: true
original: hsl(-120, -200%, -200%)
nickname: black
hex: #000000
shorthex: #000
hexa: #000000ff
shorthexa: #000f
rgb: rgb(0, 0, 0)
hsl: hsl(0, 0%, 0%)
color: hsla(-120, -200%, -200%, -5)
simple: false
original: hsla(-120, -200%, -200%, -5)
nickname: transparent
hexa: #00000000
shorthexa: #0000
rgb: null
rgba: rgba(0, 0, 0, 0)
hsl: null
hsla: hsla(0, 0%, 0%, 0)
color: hsla(240,100%,50%,0.05)
simple: false
original: hsla(240,100%,50%,0.05)
hexa: #0000ff0d
shorthexa: null
rgb: null
rgba: rgba(0, 0, 255, 0.05)
hsl: null
hsla: hsla(240,100%,50%,0.05)
color: hsl(200.5,0%,50%)
simple: true
original: hsl(200.5,0%,50%)
nickname: grey
hex: #808080
hexa: #808080ff
shorthexa: null
rgb: rgb(128, 128, 128)
hsl: hsl(200.5,0%,50%)
color: hsla(200,1.5%,50%,1)
simple: true
original: hsla(200,1.5%,50%,1)
hex: #7e8081
hexa: #7e8081ff
shorthexa: null
rgb: rgb(126, 128, 129)
hsl: hsl(200, 1%, 50%)
color: rgba(0,0,0,.5)
simple: false
original: rgba(0,0,0,.5)
hexa: #00000080
shorthexa: null
rgb: null
rgba: rgba(0,0,0,.5)
hsl: null
hsla: hsla(0, 0%, 0%, 0.5)
color: hsla(.5,.5%,.5%,.5)
simple: false
original: hsla(.5,.5%,.5%,.5)
hexa: #01010180
shorthexa: null
rgb: null
rgba: rgba(1, 1, 1, 0.5)
hsl: null
hsla: hsla(.5,.5%,.5%,.5)
color: hsla(100.5,50.5%,50.5%,.5)
simple: false
original: hsla(100.5,50.5%,50.5%,.5)
hexa: #6ac14180
shorthexa: null
rgb: null
rgba: rgba(106, 193, 65, 0.5)
hsl: null
hsla: hsla(100.5,50.5%,50.5%,.5)
color: rgba(255, 0, 0, -5)
simple: false
original: rgba(255, 0, 0, -5)
hexa: #ff000000
shorthexa: #f000
rgb: null
rgba: rgba(255, 0, 0, 0)
hsl: null
hsla: hsla(0, 100%, 50%, 0)
color: rgba(255, 0, 0, 5)
simple: true
original: rgba(255, 0, 0, 5)
nickname: red
hex: #ff0000
shorthex: #f00
hexa: #ff0000ff
shorthexa: #f00f
rgb: rgb(255, 0, 0)
hsl: hsl(0, 100%, 50%)
Running: testInvalidColors
SUCCESS: parsed invalid color none to null
SUCCESS: parsed invalid color #00000 to null
SUCCESS: parsed invalid color #ggg to null
SUCCESS: parsed invalid color rgb(a,b,c) to null
SUCCESS: parsed invalid color rgb(a,b,c,d) to null
SUCCESS: parsed invalid color rgb(1,1,1.2) to null
SUCCESS: parsed invalid color rgba(0,0,0,1%) to null
SUCCESS: parsed invalid color rgba(0,0,0,) to null
SUCCESS: parsed invalid color hsl(0,0,0) to null
SUCCESS: parsed invalid color hsl(0%, 0%, 0%) to null
SUCCESS: parsed invalid color hsla(0,,0,1) to null
SUCCESS: parsed invalid color hsl(0, 0%, 0) to null
SUCCESS: parsed invalid color hsl(a,b,c) to null
SUCCESS: parsed invalid color hsla(0,0,0,0) to null
SUCCESS: parsed invalid color hsla to null