Re: color tool

From: Knute Johnson (nospam_at_sagebrush.frazmtn.com)
Date: 02/05/04


Date: Thu, 05 Feb 2004 18:14:17 GMT

Thomas Weidenfeller wrote:
> The Chief wrote:
>
>> That's basically what I want to do. I hope the sketch above came out
>> well. Here's a description - just in case. I want to make a simple app
>> that will have three JSliders that will represent RGB (red, green,
>> blue). Also I want the hex value of the current color to be printed in
>> a text field or something like that (so that it could be easily
>> copied). Basically, I think i can do everything but I have no idea on
>> how to compute the HEX values of a color. Or how to "bind" the
>> JSliders with the hex value computing. I know this is actually the
>> whole program but any help would be greatly appreciated.
>
>
> You want to explore javax.swing.JColorChooser first, before running your
> own.
>
> /Thomas
>

Thomas:

You will only need hex numbers if you want to display the color values
in hex. It is very easy to convert an int to a hex string.

String Integer.toString(int i, int radix);

This sounds like a fun programming exercise even if there already is a
really nice built in tool (JColorChooser) to do the job. Why don't you
start writing it and post your progress and any question?

knute...
email s/nospam/knute/



Relevant Pages

  • Re: SQLCI - Insert/Select in Hex
    ... want a hex representation of the AMT number? ... '0x' prefix from the hex string then you can use SUBSTRING with TRIM: ... UPDATE STATISTICS FOR TABLE =HEXVALS; ... EXECUTE INS USING 0,'00'; ...
    (comp.sys.tandem)
  • Big-Endian bit conversion
    ... I am struggling to write a converter from bits to a hex string. ... am trying to do is to get the users inputs as far as what bits are ... Any help is appreciated as my research into this type of conversion is ...
    (microsoft.public.dotnet.languages.vb)
  • Re: What is error 8007f003
    ... Here's my procedure for getting both decimal values for any 4-byte hex ... View and assumes you have the hex string in the Clipboard to start with. ... press F5 (change the initial mode to Hex and Qword) ... press F5 (convert to decimal in Dword mode, ...
    (microsoft.public.windowsupdate)
  • Re: Retrieving int from hex in a file.
    ... a in now a string full of hex representations in the form: ... It doesn't contain a "hex ... That converts a hex string into an integer, ... You have a string containing binary data. ...
    (comp.lang.python)
  • Re: Converting binary sids to a hex string
    ... binary sid to a hex string. ... print MySid ...
    (comp.lang.python)