mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-05 10:03:56 -04:00
Fix lint issues
Had to update the test scripts to handle the alpha channel, also I note that all the hex tests are using CSS notation, not scratch notation (which is 0x not #)
This commit is contained in:
parent
b856041d9a
commit
0dcaa46107
4 changed files with 13 additions and 12 deletions
test/unit
|
@ -99,13 +99,14 @@ test('toRbgColorObject', function (t) {
|
|||
t.deepEqual(cast.toRgbColorObject('#ffffff'), {r: 255, g: 255, b: 255});
|
||||
|
||||
// Decimal (minimal, see "color" util tests)
|
||||
t.deepEqual(cast.toRgbColorObject(0), {r: 0, g: 0, b: 0});
|
||||
t.deepEqual(cast.toRgbColorObject(1), {r: 0, g: 0, b: 1});
|
||||
t.deepEqual(cast.toRgbColorObject(16777215), {r: 255, g: 255, b: 255});
|
||||
t.deepEqual(cast.toRgbColorObject(0), {a: 255, r: 0, g: 0, b: 0});
|
||||
t.deepEqual(cast.toRgbColorObject(1), {a: 255, r: 0, g: 0, b: 1});
|
||||
t.deepEqual(cast.toRgbColorObject(16777215), {a: 255, r: 255, g: 255, b: 255});
|
||||
t.deepEqual(cast.toRgbColorObject('0x80010203'), {a: 128, r: 1, g: 2, b: 3});
|
||||
|
||||
// Malformed
|
||||
t.deepEqual(cast.toRgbColorObject('ffffff'), {r: 0, g: 0, b: 0});
|
||||
t.deepEqual(cast.toRgbColorObject('foobar'), {r: 0, g: 0, b: 0});
|
||||
t.deepEqual(cast.toRgbColorObject('ffffff'), {a: 255, r: 0, g: 0, b: 0});
|
||||
t.deepEqual(cast.toRgbColorObject('foobar'), {a: 255, r: 0, g: 0, b: 0});
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
|
@ -47,11 +47,11 @@ test('decimalToHex', function (t) {
|
|||
});
|
||||
|
||||
test('decimalToRgb', function (t) {
|
||||
t.deepEqual(color.decimalToRgb(0), {r: 0, g: 0, b: 0});
|
||||
t.deepEqual(color.decimalToRgb(1), {r: 0, g: 0, b: 1});
|
||||
t.deepEqual(color.decimalToRgb(16777215), {r: 255, g: 255, b: 255});
|
||||
t.deepEqual(color.decimalToRgb(-16777215), {r: 0, g: 0, b: 1});
|
||||
t.deepEqual(color.decimalToRgb(99999999), {r: 245, g: 224, b: 255});
|
||||
t.deepEqual(color.decimalToRgb(0), {a: 255, r: 0, g: 0, b: 0});
|
||||
t.deepEqual(color.decimalToRgb(1), {a: 255, r: 0, g: 0, b: 1});
|
||||
t.deepEqual(color.decimalToRgb(16777215), {a: 255, r: 255, g: 255, b: 255});
|
||||
t.deepEqual(color.decimalToRgb(-16777215), {a: 255, r: 0, g: 0, b: 1});
|
||||
t.deepEqual(color.decimalToRgb(99999999), {a: 5, r: 245, g: 224, b: 255});
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue