
上QQ阅读APP看书,第一时间看更新
Changing the colors
HTML5 provides browsers with a full-featured color picker (typically, browsers use the native OS's color chooser). This will be used to allow the user to set the background color of the editor application itself:

The color picker is added to the index.html
page with the following HTML:
<input id="pckBackColor" type="color">
The implementation is straightforward as the color picker control provides:
InputElement cp = qs("#pckBackColor"); cp.onChange.listen((e) => document.body.style.backgroundColor = cp.value);
Because the event and property (onChange
and value
) are common to the input controls, the basic InputElement
class can be used.