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

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.

主站蜘蛛池模板: 东莞市| 抚顺市| 洞口县| 自治县| 佛山市| 黄冈市| 福清市| 普定县| 阳朔县| 万载县| 漠河县| 蚌埠市| 宣化县| 利川市| 星座| 丹棱县| 昭平县| 金湖县| 贡山| 罗平县| 定南县| 德州市| 特克斯县| 偃师市| 郴州市| 瓦房店市| 嵩明县| 呼和浩特市| 万全县| 崇阳县| 张掖市| 锡林浩特市| 綦江县| 清水县| 德格县| 都兰县| 三江| 武穴市| 铜鼓县| 云和县| 蓝山县|