Any work around for color functions not dynamically updating on AppearanceChanged?

This sort of seems to work (just extracting a color from the 64-bit numbers) but I’m not sure if it’s really “correct”. I’m worried that it will disable blending, etc. that the semantic colors are supposed to have because I wasn’t able to include the first part of the 64-bit value. The resulting colors more or less “look” pretty close though…

[code]dim bg as color
dim fg as color
dim bgValue as color

if IsDarkMode() then
bg = &c252525
fg = &cFFFEFE
bgValue = &c252525
else
bg = &cE7E7E7
fg = &c000000
bgValue = &cE7E7E7
end if[/code]