Unsaved Image Type Brush Doesn't Retain Color

When a brush is created through Lua script and has not been saved to the brushes xml file, there doesn’t seem to be a way to indicate the brush image should retain its colors. The brush will adopt a color when the foreground color is updated.

Example script:

local imageSpec <const> = ImageSpec {
    width = 32,
    height = 32,
}
local image <const> = Image(imageSpec)
image:clear(0xffaabbcc)
local brush <const> = Brush {
    type = BrushType.IMAGE,
    image = image
}
app.brush = brush
-- If foreground color was already red prior to brush creation,
-- then the brush image will be grayish as intended.
-- If the foreground color was not red, then the brush image
-- will turn red.
app.fgColor = Color { r = 255, g = 0, b = 0, a = 255 }
app.refresh()

Also looks like the case for brushes created through Edit > New Brush.

Sometimes I want the brush to adapt to the active foreground color. For example, when I create a custom brush with a graphics context. At other times, I want the brush to retain the image’s colors. For example, if I want to convert a tile from a tile set to a brush, or to make a brush from a selection.

Thanks for considering.