Commit b840f2b9 authored by Peter Billam's avatar Peter Billam

rename randomrgb to randomrgbget

parent fa35d42d
......@@ -149,7 +149,7 @@ any other colours that you may need, just like a painter would.
<A HREF="#rgbdef">rgbdef</A>
<A HREF="#rgbget">rgbget</A>
<A HREF="#rgblength">rgblength</A><BR>
<A HREF="#randomrgb">randomrgb</A>
<A HREF="#randomrgbget">randomrgbget</A>
<A HREF="#randomrgbgetn">randomrgbgetn</A> &nbsp;
<A HREF="#rgb2gray">rgb2gray</A></B>
<B><A HREF="#adjustbrightness">adjustbrightness</A></B> &nbsp;
......@@ -272,14 +272,17 @@ It also converts to integer using <I>cvi</I>.
</P>
</DD><DT>
<B><A NAME="randomrgb">[ red black darkgrey ] &nbsp; randomrgb</A></B>
<B><A NAME="randomrgbget">[ red black darkgrey ] &nbsp; randomrgbget</A></B>
</DT><DD><P>
The above invocation chooses at random one of the
colours in the array (red, black and darkgrey in this example),
and then leaves that colour on the stack.
and then leaves that colour on the stack (in <CODE>r g b</CODE> form).
</P><P>
By default it will make different a choice every time you load the
page, so if you need consistency you should invoke <I>srand</I> first.
</P><P>
The function <B>randomrgb</B> is a synonym,
retained for backward compatibility.
</P>
</DD><DT>
......@@ -296,6 +299,13 @@ the colours of the returned array will also be distinct.
</P><P>
By default it will make different choices every time you load the page,
so if you need consistency you should invoke <I>srand</I> first.
</P><P>
Note that the colours are left on the stack in an array, eg:<BR>
<CODE> &nbsp; [ violet red ]</CODE><BR>
so if you want them on the stack raw and unpacked, then add
<CODE>&nbsp; aload pop &nbsp; </CODE> to the end, eg:<BR>
<CODE> &nbsp; [ red black violet green ] 2 randomrgbgetn aload pop</CODE><BR>
which leaves on the stack eg: <CODE>&nbsp; violet red</CODE><BR>
</P>
</DD><DT>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment