-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When an entity has "ByLayer 62" we want to use the color defined in the entity instead of the layer, unless the color is 256. 256 is a special value to say that the entity has to use the color defined in the layer. Co-authored-by: Rafa <rafa@debian-BULLSEYE-live-builder-AMD64>
- Loading branch information
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import expect from 'expect' | ||
|
||
import getRGBForEntity from '../../src/getRGBForEntity' | ||
|
||
describe('colors', () => { | ||
it('Color defined in the entity but with value 256 means that we have to use the color defined in the layer.', () => { | ||
const fakeEntity = { | ||
layer: "0", | ||
colorNumber: 256 | ||
}; | ||
const fakeLayers = { | ||
"0": { | ||
colorNumber: 1 | ||
} | ||
} | ||
expect(getRGBForEntity(fakeLayers, fakeEntity)).toEqual([255, 0, 0]) | ||
}) | ||
}) |