dotoritos-kim/dxf-json

color not added to layer (when colorIndex is given)

Opened this issue · 1 comments

In the LAYER parser, when colorIndex is given, the color itself is not added

name: 'colorIndex',

For entities this does happen correctly

entity.color = getAcadColor(Math.abs(colorIndex));

@CorgiMan

ENTITY has color field (for 420) but LAYER doesn't have color field.
Note that colorIndex is different to color (the later one is color instance) and even negative value of it has meaning #reference
I believe parser should behave transparently (not introducing non-standard behavior) but I also understand the inconvenience.

@dotoritos-kim

Should we fix shared ENTITY's behavior to following?:

  • Do not give pre-computed color instance (it should be in code 420) value of ENTITY from code 62

or just add color field for convenience thought it's not standard specification?

  • Add pre-computed color instance in LAYER from code 62