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

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.

主站蜘蛛池模板: 临西县| 怀仁县| 康马县| 阿瓦提县| 宁阳县| 德安县| 桐城市| 武义县| 平陆县| 开江县| 呼伦贝尔市| 阜平县| 丁青县| 虎林市| 洪湖市| 神池县| 峡江县| 自贡市| 津市市| 桦南县| 靖西县| 石景山区| 双城市| 揭东县| 革吉县| 岐山县| 民丰县| 长顺县| 阿巴嘎旗| 西充县| 栾川县| 醴陵市| 灵宝市| 刚察县| 甘泉县| 兴仁县| 云梦县| 许昌市| 海林市| 中西区| 泽库县|