Re: Re: hexidecimal colors

by "Shay" <shay(at)wcnet.net>

 Date:  Tue, 17 Feb 1998 05:42:32 -0600
 To:  "Andrew Folkins" <afolkins(at)networkx.com>,
<hwg-graphics(at)hwg.org>
  todo: View Thread, Original


Yes, Andrew - 480K and it's a small program.  Before you go making a fool of
yourself and flaming someone on the list, you might want to inquire why it's
so large - How about the fact that this is the install package with the
necessary system files.  The actual executable is 62K - Now if you want to
argue with the size of it, I suggest you take a look at your executables on
your hd.

Shay  B-)

=====================================
Bare Tranquility Web Design
http://www.wcnet.net/shay/index.html
shay(at)wcnet.net  /  shay(at)intertex.net
Member of the HTML Writer's Guild
http://www.hwg.org/
=====================================


>
>Little? Four hundred and eighty thousand bytes?? Archived??? (Insert
>expression of shocked disbelief.)  What the #^&@ was it written in? In
>any decent language, it should only be about ten lines of code (and on
>any decent O/S about a 4k executable, but I digress).
>
>Here - free yourself up some disk space:
>
><HTML>
><HEAD>
><TITLE>RGB - Hex converter</TITLE>
>
><SCRIPT LANGUAGE="JavaScript">
><!--
>
>// Author: Andrew Folkins (afolkins(at)networkx.com)
>
>// You may bend, fold or mutilate this code any way you want, but if
>// you make a million bucks off it buy me a beer.
>
>function hex2rgb(form)
>{
>   var hexStr = "" + form.hex.value;
>
>   if (hexStr.length == 6) {
>      form.red.value   = parseInt("0x" + hexStr.substring(0, 2));
>      form.green.value = parseInt("0x" + hexStr.substring(2, 4));
>      form.blue.value  = parseInt("0x" + hexStr.substring(4, 6));
>   }
>}
>
>function toHex(dec)
>{
>   var hexChars = "0123456789ABCDEF";
>   if (dec < 0 || dec > 255)
>      return("--");
>   var t = dec % 16;
>   return(hexChars.charAt((dec - t) / 16) + hexChars.charAt(t));
>}
>
>function rgb2hex(form)
>{
>   form.hex.value = toHex(form.red.value) + toHex(form.green.value) +
toHex(form.blue.value);
>}
>
>// -->
></SCRIPT>
></HEAD>
>
><P>
>
><FORM NAME="convertForm">
><TABLE>
><TR>
><TD>
>R <INPUT TYPE="text" NAME="red" SIZE=6 VALUE="0"><BR>
>G <INPUT TYPE="text" NAME="green" SIZE=6 VALUE="0"><BR>
>B <INPUT TYPE="text" NAME="blue" SIZE=6 VALUE="0">
></TD>
><TD>
><INPUT TYPE="button" NAME="hex2rgbButton" VALUE="  <--  "
onClick="hex2rgb(this.form); return false">
><BR>
><INPUT TYPE="button" NAME="rgb2hexButton" VALUE="  -->  "
onClick="rgb2hex(this.form); return false">
></TD>
><TD>
>Hex <INPUT TYPE="text" NAME="hex" SIZE=10 VALUE="000000">
></TD>
></TR>
>
><TR>
><TD COLSPAN=3><INPUT TYPE="reset"></TD>
></TR>
></TABLE>
></FORM>
></BODY>
></HTML>
>
>--
>Andrew Folkins     afolkins(at)networkx.com
http://www.networkx.com/afolkins
>Networks Research  www.networkx.com
>

HWG: hwg-graphics mailing list archives, maintained by Webmasters @ IWA