A Tables::Layer starts as layer 0 is: white (color 7), Continuous, plotted, at the drawing’s default lineweight (-3). Color is an AutoCAD Color Index from 1 to 255 and Lineweight is in hundredths of a millimeter. To give a layer a linetype other than Continuous, add the linetype to the LTYPE table: see Linetypes.
Record.Layer names the entity’s layer. A color and lineweight left at ByLayer, as a new entity has them, are the layer’s. Edit::Add does not check that the layer exists; Audit::Check reports a layer an entity names that the table does not hold, and Audit::Repair makes it.
A layer is off when its color is negative: -8 is color 8, off. Record.Flags holds the rest as bits: 1 frozen, 2 frozen in new viewports, 4 locked. Plot false keeps a layer out of plots.
Edit::Find gives a pointer to the layer of that name, found without case, or null.
C++
if (DxfIO::Tables::Layer *found = DxfIO::Edit::Find(drawing.Layer, "grid")){ found->Color = -found->Color; std::println("{} is on, color {}", found->Record.Name, found->Color);}