|
|
Kari Kivisalo wrote:
>
> Hershel Robinson wrote:
>
> > How do I translate colors from HTML format, i.e. color="#D5EAFF" to POV
> > format?
>
> #declare AG=1;
> #global_settings{assumed_gamma AG}
>
> #macro G(Color)
> #local DisplayGamma=2.2; // Display_Gamma from povray.ini
> #local Gamma=DisplayGamma/AG;
> <pow(Color.x,Gamma),pow(Color.y,Gamma),pow(Color.z,Gamma)>
> #end
>
> #macro H2D(Hex)
> #local H=strupr(Hex)
> #local D1=asc(substr(H,1,1))-65;
> #local D2=asc(substr(H,1,1))-65;
> (D1<0 ? D1+17 : D1+10)*16 + (D2<0 ? D2+17 : D2+10)
> #end
>
> #macro Hex2Color(C)
> (<H2D(substr(C,1,2)),H2D(substr(C,3,2)),H2D(substr(C,5,2))>/255)
> #end
>
> camera{location -3*z look_at 0}
>
> box{-1,1
> pigment{rgb G(Hex2Color("D5EAFF"))}
> finish{diffuse 0 ambient 1}
> }
If that is your idea of a new user solution I would hate to see what you
provide for an advanced user :)
--
Ken Tyler
Post a reply to this message
|
|