This task is used to generate the application icons
NEEDS WORK to discuss new JSON EC4111 format that drives generator
This task invokes ./iconify
script found in the library folder that inplements this complex procedure. The
./iconify
is passed 2 parameters.
The target location. The icons are generated in target/war/res/icons
The name of the json file (.js format) that indicates what whould be made. It is assumed to reside in
target/gen-icons
Given the above information ./iconify
performs the following steps:
Validates the information. The target/gen-icons
is assumed to contain the base and devlopment image files used as the basis
to generate the icons.
Converts the json file into a linear work order file
Invokes GIMP running under control of GaelGenIconsV2.py
that reads the owrk order file and creates the icons.
This is used to generate a suite of GAEL application icons.
GAEL applications tend to be Single-page-apps with the possibility of sub-pages such as the cheque writer application.
Furthermore, in a development environment there may be both production and development tabs.
To complicate things further, there may be multiple GAEL apps running.
To handle these cases and to quicky locate a tab where dozens may be open the following strategy was chosen. The GaelGenIconsV2.py script in this same folder implements this strategy.
Each application has a unique shapes (such as square, triangle, hexagon)
Two contrasting colors are chosen for production and development and two .png images of 48 x 48 pixels are created that reflect the shape and color.
Their names should be xxxx-%COL%-%LTR%.png
where xxxx is the app nickname %COL% is the letter color and %LTR% is the actual
letter
The gael.zapIcon
function used to attach the favorite icon to the tab using the production name. The gael.zapIcon
function will swap the app name to 'devp' if it detects it is in a development environment.
Sub-pages are identified by using a lower case letter of the main app.
GaelGenIconsV2.py is executed with the four parameters described in the next section.
GaelGenIconsV2.py iterates thru each .png, letter and combo creating new icons in the target directory of the appropriate.
GaelGenIcons.py takes four parameters as follows:
runlog - the name of the output log
dir - a pointer to the gael development directory for the application. GaelGenIcons.py looks for the
base-pngs
folder containing the .png images created according to step (2) above.
It also uses this pointer to derive the output target folder of ./war/res/icons
combos - A repeating string separated by + of the format defined in section Combo Format below
cusCols - A repeating string separated by + of the format defined in section Adding Custom Colors
The iconGenStr string contains the combo string which contains repeating strings separated by a +
, each string
of the following format:
letters/col1/.../coln
Where each field contains:
letter A string of letters to be generated such as W for welcome page (To Windows W and w are the same in a filename so this script prefixes lowercase letters with a lc- in the generated name)
coln multiple color references separated by /
where each color reference is defined in the default color
table or added with the iconCusCol string.
These colors can be referenced and need not be added:
wht white rgb(255, 255, 255);
blk black rgb(0, 0, 0);
cyn cyan rgb(0, 235, 235);
yel yellow rgb(235, 201, 8);
pnk pink rgb(222, 0, 182);
blu blue rgb(0, 14, 214);
red red rgb(230, 0, 0);
Custom colors may be added using the cusCols parameter. Each custom color is a 4 part string (separated by /
). Each custom color
definition is separated by a +
.
The 1st value of the 4 part string is the color reference name and the remaining 3 parameters are the red, green, blue values for the RGB function used to generate the custom color.
For example, the string flo/0/255/0+gray/195/195/195
generates florescent green referenced by the name flo and a gray
color referenced by gray.
The task.cfb
requires entries that define what icons to generate.
For example WDPa/wht/blk+C/yel/red
is used to generate the citc
system
In addition base-icons
needs to be populated with the 48x48 px .png images (see below)
The name should be app-%COL%-%LTR%.png
where app
is the application id such as demo
or
citc
Windows paint can be used to create a simple colored shaped .png image that is 48px by 48px.
Note: It is easier to use 384 x 384 and resize just before saving.
Duplicate the image and use fill to make 2 colors as variants for production and development. Name the development one devp-
instead of the application name.
It is preferable to have the borders transparent. Assuming the border parts to be transparent are white the following steps in GIMP can be used to accomplish this.
Open the .png image with GIMP
Ensure GIMP is in RGB mode (Menu.image -> mode)
Goto Menu.layer -> transparancy -> color of Alpha
If the main color is white use a different color for the transparent border. Note the hex value and use this to set the transparent layer color.
A pop-up will show up with a default transparent color of white.
Click OK
Menu.File->export as and save the file as a .png (over the same name works).
Close GIMP without saving. You are done.
Copyright © 2018-2021, 2022, Rexcel System Inc.