Skip to content

Commit

Permalink
Fix fuchsia named color (closes sandflow#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
palemieux committed May 12, 2017
1 parent 5d8b4ce commit b034325
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
maroon: [128, 0, 0, 255],
red: [255, 0, 0, 255],
purple: [128, 0, 128, 255],
fuschia: [255, 0, 255, 255],
fuchsia: [255, 0, 255, 255],
magenta: [255, 0, 255, 255],
green: [0, 128, 0, 255],
lime: [0, 255, 0, 255],
Expand Down
20 changes: 19 additions & 1 deletion src/test/resources/unit-tests/colorExpressions.ttml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,25 @@ xmlns:ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter">
<p tts:color="#FFFFFF7F">#FFFFFF7F</p>
<p tts:color="rgb(255,128,255)">rgb(255,128,255)</p>
<p tts:color="rgba(128,255,255,63)">rgba(128,255,255,63)</p>
<p tts:color="olive">olive</p>
<p tts:color="transparent">transparent</p>
<p tts:color="black">black</p>
<p tts:color="silver">silver</p>
<p tts:color="gray">gray</p>
<p tts:color="white">white</p>
<p tts:color="maroon">maroon</p>
<p tts:color="red">red</p>
<p tts:color="purple">purple</p>
<p tts:color="fuchsia">fuchsia</p>
<p tts:color="magenta">magenta</p>
<p tts:color="green">green</p>
<p tts:color="lime">lime</p>
<p tts:color="olive">olive</p>
<p tts:color="yellow">yellow</p>
<p tts:color="navy">navy</p>
<p tts:color="blue">blue</p>
<p tts:color="teal">teal</p>
<p tts:color="aqua">aqua</p>
<p tts:color="cyan">cyan</p>
</div>
</body>
</tt>
94 changes: 93 additions & 1 deletion src/test/webapp/js/unit-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,101 @@ QUnit.test(

assert.deepEqual(
doc.body.contents[0].contents[4].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[128, 128, 0, 255]
[0, 0, 0, 0]
);

assert.deepEqual(
doc.body.contents[0].contents[5].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[0, 0, 0, 255]
);

assert.deepEqual(
doc.body.contents[0].contents[6].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[0xc0, 0xc0, 0xc0, 255]
);

assert.deepEqual(
doc.body.contents[0].contents[7].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[0x80, 0x80, 0x80, 255]
);

assert.deepEqual(
doc.body.contents[0].contents[8].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[255, 255, 255, 255]
);

assert.deepEqual(
doc.body.contents[0].contents[9].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[0x80, 0, 0, 255]
);

assert.deepEqual(
doc.body.contents[0].contents[10].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[255, 0, 0, 255]
);

assert.deepEqual(
doc.body.contents[0].contents[11].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[0x80, 0, 0x80, 255]
);

assert.deepEqual(
doc.body.contents[0].contents[12].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[255, 0, 255, 255]
);

assert.deepEqual(
doc.body.contents[0].contents[13].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[255, 0, 255, 255]
);

assert.deepEqual(
doc.body.contents[0].contents[14].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[0, 0x80, 0, 255]
);

assert.deepEqual(
doc.body.contents[0].contents[15].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[0, 255, 0, 255]
);

assert.deepEqual(
doc.body.contents[0].contents[16].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[0x80, 0x80, 0, 255]
);

assert.deepEqual(
doc.body.contents[0].contents[17].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[255, 255, 0, 255]
);

assert.deepEqual(
doc.body.contents[0].contents[18].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[0, 0, 0x80, 255]
);

assert.deepEqual(
doc.body.contents[0].contents[19].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[0, 0, 255, 255]
);

assert.deepEqual(
doc.body.contents[0].contents[20].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[0, 0x80, 0x80, 255]
);

assert.deepEqual(
doc.body.contents[0].contents[21].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[0, 255, 255, 255]
);

assert.deepEqual(
doc.body.contents[0].contents[22].styleAttrs["http://www.w3.org/ns/ttml#styling color"],
[0, 255, 255, 255]
);



}
);

Expand Down

0 comments on commit b034325

Please sign in to comment.