有沒有辦法像這樣做一個對角線漸變?我的嘗試只給我一個垂直或水平的使用JavaScript爲HTML5畫布創建動態對角線漸變?
_canvas = document.getElementById('canvas');
_stage = _canvas.getContext('2d');
var gradient = _stage.createLinearGradient(0, 0, buttonEndX, buttonEndY);
gradient.addColorStop(0, "white");
gradient.addColorStop(1, "blue");