def test_is_valid_bitmask(): validator = is_valid_bitmask(3) assert validator(0) is True assert validator(1) is True assert validator(2) is True assert validator(3) is True assert validator(4) is False
# Determines how much border there is around the text. # (45) + (90) + (63) all three required, if one of them is used 'box_fill_scale': DXFAttr(45, dxfversion='AC1021'), # background fill type flags: # 0 = off # 1 = color -> (63) < (421) or (431) # 2 = drawing window color # 3 = use background color (1 & 2) # 16 = text frame ODA specification 20.4.46 'bg_fill': DXFAttr(90, dxfversion='AC1021', validator=validator.is_valid_bitmask(BG_FILL_MASK), fixer=validator.fix_bitmask(BG_FILL_MASK)), # background fill color as ACI, required even true color is used 'bg_fill_color': DXFAttr( 63, dxfversion='AC1021', validator=validator.is_valid_aci_color, ), # 420-429? : background fill color as true color value, (63) also required # but ignored 'bg_fill_true_color': DXFAttr(421, dxfversion='AC1021'),