|
![](/i/fill.gif) |
On 25-2-2014 1:15, Kenneth wrote:
>> #macro color_vector_type() rgb= #end
>> pigment{color_vector_type() <.3,.6,.9>}
>
> YES, that works; I tried it. (Actually just rgb, not rgb= ) That came as a
> surprise; I have never used a macro in quite this way. In fact, it gives me
> ideas on how to improve some of my old scenes.
>
> Very helpful, and very much appreciated!
>
> (IMO, something should be added to the documentation that describes this kind of
> macro use. The idea of using a macro to insert a KEYWORD is not obvious there,
> and it seems to be a rather powerful feature; it's the only way I know of at
> present to do such a thing, since using a string doesn't work. *Maybe* it could
> also be done by using a #read block, reading in a simple #written rgb, for
> example. Just a guess.)
>
Just out of curiosity, what would the advantage be of this trick? I
assume that calling such a macro would increase parsing time, even if by
only a tiny, tiny bit ;-)
Thomas
Post a reply to this message
|
![](/i/fill.gif) |