官术网_书友最值得收藏!

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:

Changing the colors

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.

主站蜘蛛池模板: 七台河市| 云和县| 离岛区| 芦溪县| 荥阳市| 惠来县| 河池市| 东辽县| 青阳县| 九台市| 聂荣县| 鹰潭市| 黔江区| 杭锦旗| 宜川县| 长岛县| 闽清县| 凤山县| 犍为县| 抚宁县| 永仁县| 阿拉善右旗| 满城县| 许昌市| 林芝县| 和龙市| 子长县| 基隆市| 沁源县| 苏尼特右旗| 嘉义县| 察隅县| 景洪市| 余庆县| 台江县| 浦城县| 寿宁县| 绥芬河市| 霍林郭勒市| 新沂市| 阿拉善盟|