我创建了此代码,以将模板的一种强调色替换为另一种(ObjectThemeColors),亮度(色调和阴影)元素被否决了,所有旧强调色的阴影都替换为与之相同的阴影给定新颜色的颜色,在更改为新的强调颜色时,有人可以帮助保持亮度/阴影吗?
var string = "aaaaaaDqqqqq",
substring = "D";
if(string.includes(substring)){
console.log("contain")
}else{
console.log("don't contain")
}
答案 0 :(得分:0)
在更改ObjectThemeColor之前,先拾取当前的TintAndShade和亮度,然后在更改ObjectThemeColor之后再次应用它们。简化示例:
With oSh.Fill.ForeColor
lThemeColor = .ObjectThemeColor
sBrightness = .Brightness
sTintShade = .TintAndShade
.ObjectThemeColor = lThemeColor + 1
.Brightness = sBrightness
.TintAndShade = sTintShade
End With
实际上,我认为仅保存亮度可能就足够了;试试看,让我们知道。