def _apply_fields(self, func: Callable[([RGField, int], int)], value: int) -> int:
    new_val = 0
    for field in self.fields:
        field_new_val = func(field, (value >> field.lsb))
        new_val |= (field_new_val << field.lsb)
    return new_val
def _apply_fields(self, func: Callable[([RGField, int], int)], value: int) -> int:
    new_val = 0
    for field in self.fields:
        field_new_val = func(field, (value >> field.lsb))
        new_val |= (field_new_val << field.lsb)
    return new_val