POV-Ray : Newsgroups : povray.general : color to grey : Re: color to grey Server Time
19 May 2024 05:26:14 EDT (-0400)
  Re: color to grey  
From: Chris Huff
Date: 31 Mar 2001 08:36:16
Message: <chrishuff-27BAFB.08361331032001@news.povray.org>
In article <3ac43695$1@news.povray.org>, "Bonsai" <bon### [at] b0n541net> 
wrote:


> groups:
> 
> How can I calculate the grey equivalent of a given rgb color?

Try this macro:
#macro Grayscale(Color)
    (0.297*Color.red + 0.589*Color.green + 0.114*Color.blue)
#end

This uses the same equation that POV uses internally.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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