[sugar] icon assistance/validation

Eben Eliason eben.eliason
Thu Mar 20 13:44:58 EDT 2008


>
>
> I also added a warning when no entities are replaced within the icon.
> Do you feel that I should actually increase the granularity, instead
> providing warnings separately for strokes and fills?
>

I chose to separate these, so that it will warn that no strokes were
replaced even if some fills were, and vice versa.


> The only remaining "oddity" in the script right now is that,
> regardless of the colors that are used for stroke/fill entities, the
> script will set the stroke and fill colors in the output to (#666666,
> #ffffff) when a guess is made.  On the other hand, when you explicitly
> pass them with -s and -f, the converted icon will retain the
> explicitly set colors.  What do people think correct behavior is here?
>  Always resort to the default color pair, even when the colors are
> passed? (You can just edit the entity declarations at the top to set
> it to anything after running the script...) Always use the passed or
> guessed values?  (I didn't do it this way because, due to some
> restrictions in the way the SVG DOM can be edited, I have to insert
> the entities into the raw text before parsing the DOM, which means I
> have to do it before I can make a guess as to the correct entity
> colors...
>

I've taken care of this, as it bugged me and seemed inconsistent.  The
script will now output a sugarized icon that looks exactly the same as the
input, by default.  If desired, you can pass the -d flag to insert the
default color entities that will be recommended for "uninstantiated activity
icons".  Note that the output colors are therefore independent of the colors
passed in with -s and -f, which are used solely to tell the script which hex
values to replace with the entities, and not what color to output.  I
considered adding -S and -F options which would specify the output colors,
but I didn't really think of a use case for this...it seems that the input
colors or the defaults should be sufficient.

Finally, I noticed after my experiments with the Moon icon that the guess
algorithm was completely useless, since it used a mask (it always guessed
black and white).  To get around this, I now filter out mask elements when
performing the guess, so it works just fine and makes a valid guess with any
number of masks.

After the above changes and another batch of bug fixes and robustness
improvements, mostly with respect to the -m capability, I'm finally
satisfied enough with this to write it up on the wiki.  I intend to do that
later this afternoon; feel free to try the attached script at your whim.
 Thanks for your feedback again!

- Eben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.laptop.org/pipermail/sugar/attachments/20080320/a2ef42a5/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sugar-iconify
Type: application/octet-stream
Size: 12701 bytes
Desc: not available
Url : http://lists.laptop.org/pipermail/sugar/attachments/20080320/a2ef42a5/attachment.obj 



More information about the Sugar-devel mailing list