[scribus-dev] Fw: Re: [scribus-team] Re: CxF- colour plattes (e.g. from freie Farbe) in Open Source applications

Gregory Pittman gpittman at iglou.com
Wed Dec 6 14:59:59 UTC 2017


On 12/06/2017 06:09 AM, Jan-Peter Homann wrote:
> Hi Greg and Christoph, (cc. Matthias Betz)
> Thank you very much for your offer to write a Scribus script to create
> automatically an HLC colour Atlas from an Palette.
> 
> We will provide you a special palette containing the HLC color names and
> the CMYK values. (I have to check with Matthias, to provide you the
> latest version...)
> 
> FreieFarbe will pay / donate for the creation of this script. Either to
> the Scribus-project to Greg directly or e.g both half/half.
> 
> I have also to talk to Matthias, if he already converted an
> InDesign-Template to Scribus for the HLC Colour atlas to provide you
> with the exact measurements.
> 
> Greg an Christoph, could you provide us a rough estimation, how long you
> need to create such a script (don´t hesitate to double your amount of
> time for some tests etc...)
> 

Hi Jan-Peter,

Not having done this for "hire" so to speak, I have a hard time
estimating how long, but this seems a pretty simple task. The trickiest
part is the logic that goes into the assignment of colors, since they
not only need to be all there, but all in the right position on each
page relative to each other.

Anyway, here is a basic script that creates a single-page new document
measuring 140x100mm (my best guess at what you're looking for), and on
it 108 rectangles each measuring 10x10mm, starting from the left lower
corner of the page, working right then up. So the left lowest rectangle
is Polygon1 and the right-most top is Polygon108. I've added the script
as an attachment for those not getting this via the mail lists.

=================script======================
#!/usr/bin/env python

import scribus

if scribus.newDoc((140, 100), (0,0,0,0),scribus.PORTRAIT, 1,
scribus.UNIT_MILLIMETERS, scribus.NOFACINGPAGES, scribus.FIRSTPAGERIGHT):
    xlocus = 10
    ylocus = 85
    while (ylocus > 2):
        while (xlocus < 125):
            R = scribus.createRect(xlocus, ylocus, 10, 10)
            xlocus = xlocus + 10
        ylocus = ylocus - 10
        xlocus = 10

scribus.setRedraw(1)
scribus.redrawAll()

=================end script==================

After this, the idea would be to work in the logic of color assignment
to the fill (I've already changed the border color to None as they were
created), and add new pages as needed. It could also be done to create
all the pages and rectangles at the beginning, then start a loop to
modify the rectangle fill afterward, because of the numbering scheme of
the Polygons.

Greg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HLC.py
Type: text/x-python
Size: 503 bytes
Desc: not available
URL: <http://lists.scribus.net/pipermail/scribus-dev/attachments/20171206/d471c7a2/attachment.py>


More information about the scribus-dev mailing list