* The default is a 400x400 2d canvas, with 0, 16, 235, and 255 "gray" outer quads, and 50%-red, -green, -blue, and -gray inner quads.
* We default to showing the settings pane when loaded without a query string. This way, someone naively opens this in a browser, they can immediately see all available options.
* The "Publish" button updates the url, and so causes the settings pane to hide.
* Clicking on the canvas toggles the settings pane for further editing.
-->
<head>
<meta charset="utf-8">
<title>color_quads.html (2022-07-15)</title>
</head>
<body>
<div id="e_settings">
Image override: <input id="e_img" type="text">
const W = parseInt(e_width.value);
const H = parseInt(e_height.value);
context.canvas.width = W;
context.canvas.height = H;
e_canvas_holder.appendChild(e_canvas);
// If we don't snap to the device pixel grid, borders between color blocks
// will be filtered, and this causes a lot of fuzzy() annotations.
set_device_pixel_size(e_canvas, e_canvas);
pad_top_left_to_device_pixels(e_canvas);
// -
let fillFromElem;
if (context.fillRect) {
const c2d = context;
fillFromElem = (e, left, top, w, h) => {
if (!e.value) return;
c2d.fillStyle = e.value;
c2d.fillRect(left, top, w, h);
};
} else if (context.drawArrays) {
const gl = context;
gl.enable(gl.SCISSOR_TEST);
gl.disable(gl.DEPTH_TEST);
fillFromElem = (e, left, top, w, h) => {
if (!e.value) return;
const rgba = parse_css_color_npa(e.value.trim());
if (false && options.premultipliedAlpha) {
for (let i = 0; i < 3; i++) {
rgba[i] *= rgba[3];
}
}
e_publish.addEventListener("click", () => {
let settings = [];
for (const n of Object.values(SETTING_NODES)) {
if (n.value == n._default) continue;
settings.push(`${n.id}=${n.value}`);
}
settings = settings.join("&");
if (!settings) {
settings = "="; // Empty key-value pair is "publish with default settings"
}
window.location.search = "?" + settings;
});
</script>
</body>
</html>
Messung V0.5
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.37Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.