Remove support for 4- and 8- digit hex colors

These are not supported by canvas.
This commit is contained in:
Tom Payne
2013-11-14 01:32:45 +01:00
parent d60bc61a72
commit 6b61f45379
2 changed files with 13 additions and 18 deletions

View File

@@ -21,19 +21,10 @@ describe('ol.color', function() {
expect(ol.color.fromString('#087')).to.eql([0, 136, 119, 1]);
});
it('can parse 4-digit hex colors', function() {
expect(ol.color.fromString('#1234')).to.eql([17, 34, 51, 68 / 255]);
});
it('can parse 6-digit hex colors', function() {
expect(ol.color.fromString('#56789a')).to.eql([86, 120, 154, 1]);
});
it('can parse 8-digit hex colors', function() {
expect(ol.color.fromString('#bcdef012')).to.eql(
[188, 222, 240, 18 / 255]);
});
it('can parse rgb colors', function() {
expect(ol.color.fromString('rgb(0, 0, 255)')).to.eql([0, 0, 255, 1]);
});