POV-Ray : Newsgroups : povray.general : Strange syntax Server Time
25 Feb 2026 10:24:27 EST (-0500)
  Strange syntax (Message 1 to 5 of 5)  
From: kurtz le pirate
Subject: Strange syntax
Date: 24 Feb 2026 11:36:24
Message: <699dd388$1@news.povray.org>
Hello,


I found this in some very old code (2016) :

light_source {
   <0, 100, 0>
   color White=1
   }


and with thise, the light in the scene is red.
of course, back to "normal" color White give white light.



How this <color White=1> is interpreted and why does it turn red?




-- 
kurtz le pirate
compagnie de la banquise


Post a reply to this message

From: Bald Eagle
Subject: Re: Strange syntax
Date: 24 Feb 2026 12:25:00
Message: <web.699dddebf71f0dcaa433a43625979125@news.povray.org>
kurtz le pirate <kur### [at] freefr> wrote:
> Hello,
>
>
> I found this in some very old code (2016) :
>
> light_source {
>    <0, 100, 0>
>    color White=1
>    }

> How this <color White=1> is interpreted and why does it turn red?

Yeah, that's weird.
The parser is a strange and wondrous thing.

Presumably you are including colors.inc.
Can you output the color value of White as a 5D vector to the debug stream
before instantiating the light source, and then show what happens to it after?

- BE


Post a reply to this message

From: Cousin Ricky
Subject: Re: Strange syntax
Date: 24 Feb 2026 22:21:40
Message: <699e6ac4$1@news.povray.org>
On 2026-02-24 12:36 (-4), kurtz le pirate wrote:
>
> How this <color White=1> is interpreted and why does it turn red?

Where does the identifier `White` come from?  Like BE, I would like to
know its value.

My understanding of that syntax is that it compares each component of
`White` with 1.  But if `White` comes from colors.inc, the
component-wise comparison would still end up as white.  The only way I
can see this evaluating as red is if `White.red` is exactly 1, and
`White.green`, `White.blue`, `White.filter`, and `White.transmit` are
all something other than 1.


Post a reply to this message

From: kurtz le pirate
Subject: Re: Strange syntax
Date: 25 Feb 2026 03:56:54
Message: <699eb956@news.povray.org>
On 25/02/2026 04:21, Cousin Ricky wrote:
> On 2026-02-24 12:36 (-4), kurtz le pirate wrote:
>>
>> How this <color White=1> is interpreted and why does it turn red?
> 
> Where does the identifier `White` come from?  Like BE, I would like to
> know its value.

White come from "colors.inc"



> My understanding of that syntax is that it compares each component of
> `White` with 1.  But if `White` comes from colors.inc, the
> component-wise comparison would still end up as white.  The only way I
> can see this evaluating as red is if `White.red` is exactly 1, and
> `White.green`, `White.blue`, `White.filter`, and `White.transmit` are
> all something other than 1.
> 

I also thought that "=" was interpreted as a comparison operator.

But since “White” is defined by rgb 1, that doesn't explain anything.







-- 
kurtz le pirate
compagnie de la banquise


Post a reply to this message

From: Bald Eagle
Subject: Re: Strange syntax
Date: 25 Feb 2026 06:50:00
Message: <web.699ee0d4f71f0dca1f9dae3025979125@news.povray.org>
[before light_source]
White = <1.000, 1.000, 1.000, 0.000, 0.000>

[after light_source]
White = <1.000, 1.000, 1.000, 0.000, 0.000>
"C:\Users\Mini\Documents\POV-Ray\v3.8-beta\scenes\_CodeScratchPad.pov" line 13:
Parse Warning: Expected pure RGB color expression,
unexpected filter and transmit components will have no effect.
-
"C:\Users\Mini\Documents\POV-Ray\v3.8-beta\scenes\_CodeScratchPad.pov" line 16:
Parse Error: Parse halted by #error directive: No
objects in scene

I'm thinking that the red must be coming from something else.
Post the whole scene, a link, or at least more to work from?

- BE


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.