Check out Atomic Chess, our featured variant for November, 2024.

Enter Your Reply

The Comment You're Replying To
H. G. Muller wrote on Sun, Oct 7, 2018 08:10 AM UTC:

I am a bit skeptical about whether making piece colors fully customizable is really worth the effort, compared to just preparing a handful of sets of different colors as normal gif, jpeg or png images. It seems far more useful to have customizable size. But I suppose the technical solution would be much the same, along the lines Fergus suggests: rather than linking to image files we could link to a PHP or CGI program to render the pieces with the desired size and color, e.g. from SVG prototypes, and supply those to the client.

I assume most browser will also cache data fetched from CGI scripts as long as the same arguments get passed to the script; for this reason I always append a dummy "&t=<TIMESTAMP> when requesting 'volatile' data, e.g. when polling whether another party has appended a new move to a game to be fetched. So once a client has used the renderer to obtain a set of pieces of his preferred size and color, he will cache the resulting images, and as long as he sticks to that size, color and pieces he used before, he will cause no further load on the server-side renderer.

I guess it would not even require any adaptations of my Interactive Diagram script to use such a 'dynamic' piece set; the user can just include the name of the script file and the fixed arguments he wants for his design as part of the pathname of the 'graphicsDir' parameter of the diagram, e.g.

graphicsDir=/membergraphics/piece.cgi?c=#8000FF&s=40&t=

where 'c' and 's' are the color and size arguments, and t would specify the piece type in a format that normally is used for the image filename (but with an empty string for the graphicsType extension).

I don't think it would be necessary to limit ourselves to just specifying one color. In WinBoard rendering pieces from true-type chess fonts (the nearest thing Windows supported to SVG), you can independently specify foreground and background colors for both the white and black pieces. It turns out that pieces that are not purely black or very dark gray (like #202020) always need a black outline, or they will look extremely ugly (even when very dark blue). WinBoard contains a special set of ('solid') images for the black pieces, where the 'outline' basically fills the entire glyph, exept for some line details in it (such as the cross on the Bishop). But for people that wanted to change the black piece color, I had to provide an extra option that forced using the 'outline' images normally only used for the white pieces also for black, and have the /blackPieceColor option then apply to the filling of this outline, rather than to the outline itself (as was done for the 'solid' pieces. With the font rendering the outline and filling color can be specified separately, and even then the filling color is subject to a shading gradient to create a 3D illiusion.

SVG images are normal text strings; even if the rendering routine would not supply an option to replace certain colors by certain others, we should be able to write a small routine that locates the color spec inside the SVG file, and substitute it by the color spec for the desired color, before we pass the string to the renderer.


Edit Form

Comment on the page Alfaerie Variant Chess Graphics

Conduct Guidelines
This is a Chess variants website, not a general forum.
Please limit your comments to Chess variants or the operation of this site.
Keep this website a safe space for Chess variant hobbyists of all stripes.
Because we want people to feel comfortable here no matter what their political or religious beliefs might be, we ask you to avoid discussing politics, religion, or other controversial subjects here. No matter how passionately you feel about any of these subjects, just take it someplace else.
Avoid Inflammatory Comments
If you are feeling anger, keep it to yourself until you calm down. Avoid insulting, blaming, or attacking someone you are angry with. Focus criticisms on ideas rather than people, and understand that criticisms of your ideas are not personal attacks and do not justify an inflammatory response.
Quick Markdown Guide

By default, new comments may be entered as Markdown, simple markup syntax designed to be readable and not look like markup. Comments stored as Markdown will be converted to HTML by Parsedown before displaying them. This follows the Github Flavored Markdown Spec with support for Markdown Extra. For a good overview of Markdown in general, check out the Markdown Guide. Here is a quick comparison of some commonly used Markdown with the rendered result:

Top level header: <H1>

Block quote

Second paragraph in block quote

First Paragraph of response. Italics, bold, and bold italics.

Second Paragraph after blank line. Here is some HTML code mixed in with the Markdown, and here is the same <U>HTML code</U> enclosed by backticks.

Secondary Header: <H2>

  • Unordered list item
  • Second unordered list item
  • New unordered list
    • Nested list item

Third Level header <H3>

  1. An ordered list item.
  2. A second ordered list item with the same number.
  3. A third ordered list item.
Here is some preformatted text.
  This line begins with some indentation.
    This begins with even more indentation.
And this line has no indentation.

Alt text for a graphic image

A definition list
A list of terms, each with one or more definitions following it.
An HTML construct using the tags <DL>, <DT> and <DD>.
A term
Its definition after a colon.
A second definition.
A third definition.
Another term following a blank line
The definition of that term.