Reads the layout background colour from the database for the given space.
Looks up MODELBKCOLOR or PAPERBKCOLOR (via layoutBackgroundSysVar) through AcDbSysVarManager, then converts the AcCmColor result to a packed RGB value with canvasBackgroundFromColor.
MODELBKCOLOR
PAPERBKCOLOR
Drawing database whose sysvars are read.
true to read model-space background; false to read paper-space background.
true
false
Packed 24-bit RGB canvas background colour.
const bg = readLayoutBackgroundColor(database, true)renderer.setClearColor(bg) Copy
const bg = readLayoutBackgroundColor(database, true)renderer.setClearColor(bg)
AcTrView2d.syncDisplaySysVars — applies this on document open
Reads the layout background colour from the database for the given space.
Looks up
MODELBKCOLORorPAPERBKCOLOR(via layoutBackgroundSysVar) through AcDbSysVarManager, then converts the AcCmColor result to a packed RGB value with canvasBackgroundFromColor.