0
內的變量,如果我有使用如何訪問另一組變量
VAR箱=「RGBA(255,255,255,1)」中設置的變量;
如何以後只更改我選擇的顏色變成0-255?
例如,如果我使用的是滑塊以更改值...
<div class="slider">
<input type = "range" min="0" max="255" onchange="box=value"/>
<output id="box">127</output>
</div>
如何只能引用只是一種顏色?
,然後在更先進的功能
var drawLine = function (x0, y0, x1, y1, alpha) {
context.lineWidth = "hairline";
context.strokeStyle = "rgba(255,255,255," + alpha + ")";
context.beginPath();
context.moveTo(x0, y0);
context.lineTo(x1, y1);
context.closePath();
context.stroke();
};
例如說,我只希望的StrokeStyle只變成綠色一次。我怎樣才能在裏面引用這個變量?