Two-Dimensional Expression Layout
Michael Selik
michael.selik at gmail.com
Sat Aug 20 20:52:05 EDT 2016
On Sat, Aug 20, 2016 at 8:43 PM Michael Selik <michael.selik at gmail.com>
wrote:
> On Sat, Aug 20, 2016 at 6:21 PM Lawrence D’Oliveiro <
> lawrencedo99 at gmail.com> wrote:
>
>> > p0 = (0, 0)
>> > p1 = (major_dim, 0)
>> > colour_stops = (0, rect_1_colour), (1, complement(rect_1_colour))
>> > rect_1_pattern = qah.Pattern.create_linear(p0, p1, colour_stops)
>>
>> That’s an example of what I mean about obscure structure.
>>
>
> To each his own. I was assuming all those variable names meant something
> to you. If not, then I expect it'd read well with good names. In this
> example, I think the abbreviations and numbers in the names could be
> changed to something more meaningful.
>
I think that came out wrong. Let me try again...
origin = 0, 0
destination = width, 0
start_color = 0, selected_color
stop_color = 1, complement(selected_color)
pattern = qah.Pattern.from_line(origin, destination, (start_color,
stop_color))
Better?
I wasn't sure what the numbers 0 and 1 are doing for the colour_stops.
More information about the Python-list
mailing list