Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

RGB Color Value From ChooseColor

6 posts in General Discussion (Chinese) Last posting was on 2006-06-07 14:41:54.0Z
John Duffy Posted on 2006-06-06 15:26:51.0Z
Sender: 6d1b.447d73e4.1804289383@sybase.com
From: John Duffy
Newsgroups: sybase.public.chinese.powerbuilder.general
Subject: RGB Color Value From ChooseColor
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <44859ebb.6e37.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 6 Jun 2006 08:26:51 -0700
X-Trace: forums-1-dub 1149607611 10.22.241.41 (6 Jun 2006 08:26:51 -0700)
X-Original-Trace: 6 Jun 2006 08:26:51 -0700, 10.22.241.41
Lines: 11
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.chinese.powerbuilder.general:35
Article PK: 104086

Hi,

I'm trying to swap color values between hexadecimal and RGB
values. The hex representations are displayed on a dw and
used in UNIX programs. My problem is that I'm trying to use
ChooseColor to allow the user to select colours and then
convert those to hex. However I can't tell what the RGB
values are from the long number returned from ChooseColor,
to then convert it to Hex. Any idea how to do this?
Thanks,
John


mason Posted on 2006-06-06 15:43:35.0Z
From: "mason" <masonliu@msn.com>
Newsgroups: sybase.public.chinese.powerbuilder.general
References: <44859ebb.6e37.1681692777@sybase.com>
Subject: Re: RGB Color Value From ChooseColor
Lines: 17
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
NNTP-Posting-Host: h-64-105-191-82.chcgilgm.covad.net
X-Original-NNTP-Posting-Host: h-64-105-191-82.chcgilgm.covad.net
Message-ID: <4485a2a7@forums-1-dub>
Date: 6 Jun 2006 08:43:35 -0700
X-Trace: forums-1-dub 1149608615 64.105.191.82 (6 Jun 2006 08:43:35 -0700)
X-Original-Trace: 6 Jun 2006 08:43:35 -0700, h-64-105-191-82.chcgilgm.covad.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.chinese.powerbuilder.general:36
Article PK: 104081

Search Google on "rgb conversion".

Here is an example: http://www.javascripter.net/faq/hextorgb.htm

<John Duffy> wrote in message news:44859ebb.6e37.1681692777@sybase.com...
> Hi,
>
> I'm trying to swap color values between hexadecimal and RGB
> values. The hex representations are displayed on a dw and
> used in UNIX programs. My problem is that I'm trying to use
> ChooseColor to allow the user to select colours and then
> convert those to hex. However I can't tell what the RGB
> values are from the long number returned from ChooseColor,
> to then convert it to Hex. Any idea how to do this?
> Thanks,
> John


John Duffy Posted on 2006-06-06 16:07:17.0Z
Sender: 6d1b.447d73e4.1804289383@sybase.com
From: John Duffy
Newsgroups: sybase.public.chinese.powerbuilder.general
Subject: Re: RGB Color Value From ChooseColor
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4485a835.6fbb.1681692777@sybase.com>
References: <4485a2a7@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 6 Jun 2006 09:07:17 -0700
X-Trace: forums-1-dub 1149610037 10.22.241.41 (6 Jun 2006 09:07:17 -0700)
X-Original-Trace: 6 Jun 2006 09:07:17 -0700, 10.22.241.41
Lines: 28
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.chinese.powerbuilder.general:37
Article PK: 104084

Thanks Mason, but that's not the problem. I can convert
between hex and RGB values, it's that the ChooseColor
function returns the value as if its been through the RGB
function. So my problem is how can I reverse the calculation
65536 * Blue+ 256 * Green+ Red
ie White (RGB 255,255,255) = 16777215, but how can I get
255,255,255 from 16777215?
Thanks, John

> Search Google on "rgb conversion".
>
> Here is an example:
> http://www.javascripter.net/faq/hextorgb.htm
>
>
> <John Duffy> wrote in message
> > news:44859ebb.6e37.1681692777@sybase.com... Hi,
> >
> > I'm trying to swap color values between hexadecimal and
> > RGB values. The hex representations are displayed on a
> > dw and used in UNIX programs. My problem is that I'm
> > trying to use ChooseColor to allow the user to select
> > colours and then convert those to hex. However I can't
> > tell what the RGB values are from the long number
> > returned from ChooseColor, to then convert it to Hex.
> > Any idea how to do this? Thanks,
> > John


mason Posted on 2006-06-06 20:30:42.0Z
From: "mason" <masonliu@msn.com>
Newsgroups: sybase.public.chinese.powerbuilder.general
References: <4485a2a7@forums-1-dub> <4485a835.6fbb.1681692777@sybase.com>
Subject: Re: RGB Color Value From ChooseColor
Lines: 43
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
NNTP-Posting-Host: h-64-105-191-82.chcgilgm.covad.net
X-Original-NNTP-Posting-Host: h-64-105-191-82.chcgilgm.covad.net
Message-ID: <4485e5f2@forums-1-dub>
Date: 6 Jun 2006 13:30:42 -0700
X-Trace: forums-1-dub 1149625842 64.105.191.82 (6 Jun 2006 13:30:42 -0700)
X-Original-Trace: 6 Jun 2006 13:30:42 -0700, h-64-105-191-82.chcgilgm.covad.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.chinese.powerbuilder.general:38
Article PK: 104085

Here is an example of a conversion function.

let's say ll_rgb=16777215

li_blue=int(ll_rgb/65536.0)

ll_rgb -= li_blue*Long(65536)

li_green=int(ll_rgb/256.0)

ll_red = ll_rgb - li_green*256

<John Duffy> wrote in message news:4485a835.6fbb.1681692777@sybase.com...
> Thanks Mason, but that's not the problem. I can convert
> between hex and RGB values, it's that the ChooseColor
> function returns the value as if its been through the RGB
> function. So my problem is how can I reverse the calculation
> 65536 * Blue+ 256 * Green+ Red
> ie White (RGB 255,255,255) = 16777215, but how can I get
> 255,255,255 from 16777215?
> Thanks, John
>
>
>> Search Google on "rgb conversion".
>>
>> Here is an example:
>> http://www.javascripter.net/faq/hextorgb.htm
>>
>>
>> <John Duffy> wrote in message
>> > news:44859ebb.6e37.1681692777@sybase.com... Hi,
>> >
>> > I'm trying to swap color values between hexadecimal and
>> > RGB values. The hex representations are displayed on a
>> > dw and used in UNIX programs. My problem is that I'm
>> > trying to use ChooseColor to allow the user to select
>> > colours and then convert those to hex. However I can't
>> > tell what the RGB values are from the long number
>> > returned from ChooseColor, to then convert it to Hex.
>> > Any idea how to do this? Thanks,
>> > John


John Duffy Posted on 2006-06-07 14:12:29.0Z
Sender: 6d1b.447d73e4.1804289383@sybase.com
From: John Duffy
Newsgroups: sybase.public.chinese.powerbuilder.general
Subject: Re: RGB Color Value From ChooseColor
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4486decd.7f37.1681692777@sybase.com>
References: <4485e5f2@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 7 Jun 2006 07:12:29 -0700
X-Trace: forums-1-dub 1149689549 10.22.241.41 (7 Jun 2006 07:12:29 -0700)
X-Original-Trace: 7 Jun 2006 07:12:29 -0700, 10.22.241.41
Lines: 50
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.chinese.powerbuilder.general:39
Article PK: 104087

That's brilliant Mason,

Thanks very much,

John

> Here is an example of a conversion function.
>
> let's say ll_rgb=16777215
>
> li_blue=int(ll_rgb/65536.0)
>

> ll_rgb -= li_blue*Long(65536)
>
> li_green=int(ll_rgb/256.0)
>
> ll_red = ll_rgb - li_green*256
>
>
>
> <John Duffy> wrote in message
> > news:4485a835.6fbb.1681692777@sybase.com... Thanks Mason
> > , but that's not the problem. I can convert between hex
> > and RGB values, it's that the ChooseColor function
> > returns the value as if its been through the RGB
> function. So my problem is how can I reverse the
> > calculation 65536 * Blue+ 256 * Green+ Red
> > ie White (RGB 255,255,255) = 16777215, but how can I get
> > 255,255,255 from 16777215?
> > Thanks, John
> >
> >
> >> Search Google on "rgb conversion".
> >>
> >> Here is an example:
> >> http://www.javascripter.net/faq/hextorgb.htm
> >>
> >>
> >> <John Duffy> wrote in message
> >> > news:44859ebb.6e37.1681692777@sybase.com... Hi,
> >> >
> >> > I'm trying to swap color values between hexadecimal
> and >> > RGB values. The hex representations are displayed
> on a >> > dw and used in UNIX programs. My problem is that
> I'm >> > trying to use ChooseColor to allow the user to
> select >> > colours and then convert those to hex. However
> I can't >> > tell what the RGB values are from the long
> number >> > returned from ChooseColor, to then convert it
> to Hex. >> > Any idea how to do this? Thanks,
> >> > John


mason Posted on 2006-06-07 14:41:54.0Z
From: "mason" <masonliu@msn.com>
Newsgroups: sybase.public.chinese.powerbuilder.general
References: <4485e5f2@forums-1-dub> <4486decd.7f37.1681692777@sybase.com>
Subject: Re: RGB Color Value From ChooseColor
Lines: 56
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
NNTP-Posting-Host: h-64-105-191-82.chcgilgm.covad.net
X-Original-NNTP-Posting-Host: h-64-105-191-82.chcgilgm.covad.net
Message-ID: <4486e5b2@forums-1-dub>
Date: 7 Jun 2006 07:41:54 -0700
X-Trace: forums-1-dub 1149691314 64.105.191.82 (7 Jun 2006 07:41:54 -0700)
X-Original-Trace: 7 Jun 2006 07:41:54 -0700, h-64-105-191-82.chcgilgm.covad.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.chinese.powerbuilder.general:40
Article PK: 104088

This is probably not the right group to hang out for English postings. You
may want to visit sybase.public.powerbuilder.whatever forums instead.

<John Duffy> wrote in message news:4486decd.7f37.1681692777@sybase.com...
> That's brilliant Mason,
>
> Thanks very much,
>
> John
>> Here is an example of a conversion function.
>>
>> let's say ll_rgb=16777215
>>
>> li_blue=int(ll_rgb/65536.0)
>>
>
>> ll_rgb -= li_blue*Long(65536)
>>
>> li_green=int(ll_rgb/256.0)
>>
>> ll_red = ll_rgb - li_green*256
>>
>>
>>
>> <John Duffy> wrote in message
>> > news:4485a835.6fbb.1681692777@sybase.com... Thanks Mason
>> > , but that's not the problem. I can convert between hex
>> > and RGB values, it's that the ChooseColor function
>> > returns the value as if its been through the RGB
>> function. So my problem is how can I reverse the
>> > calculation 65536 * Blue+ 256 * Green+ Red
>> > ie White (RGB 255,255,255) = 16777215, but how can I get
>> > 255,255,255 from 16777215?
>> > Thanks, John
>> >
>> >
>> >> Search Google on "rgb conversion".
>> >>
>> >> Here is an example:
>> >> http://www.javascripter.net/faq/hextorgb.htm
>> >>
>> >>
>> >> <John Duffy> wrote in message
>> >> > news:44859ebb.6e37.1681692777@sybase.com... Hi,
>> >> >
>> >> > I'm trying to swap color values between hexadecimal
>> and >> > RGB values. The hex representations are displayed
>> on a >> > dw and used in UNIX programs. My problem is that
>> I'm >> > trying to use ChooseColor to allow the user to
>> select >> > colours and then convert those to hex. However
>> I can't >> > tell what the RGB values are from the long
>> number >> > returned from ChooseColor, to then convert it
>> to Hex. >> > Any idea how to do this? Thanks,
>> >> > John