2

如何TextEditorDecorationType在 Visual Studio Code API 中应用缓出过渡?

var flashDecorationType = vscode.window.createTextEditorDecorationType({
  backgroundColor: 'rgba(100,200,100,0.5)'
});

var range = getCurrentRange();
var decoration = { range: range }
activeEditor.setDecorations(flashDecorationType, [decoration]);

上面的代码应用了装饰,但它是静态的,我希望背景颜色在 1 秒内消失。这可以在vscode中做到吗?

我希望能够做这样的事情:

var flashDecorationType = vscode.window.createTextEditorDecorationType({
  backgroundColor: 'rgba(100,200,100,0.5)',
  transition: 'backgroundColor 1s ease-out'
});
4

0 回答 0