Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

6 May, 2024: The networking issue during the past two days has been identified and appears to be fixed. Will keep monitoring.


devel / comp.lang.xharbour / Re: convert color to rgb

SubjectAuthor
* convert color to rgbMichael Hagl
+- convert color to rgbdlzc
`* convert color to rgbElla Stern
 `* convert color to rgbMichael Hagl
  `- convert color to rgbtimepro timesheet

1
convert color to rgb

<88a624c5-8fea-4860-9a2b-725ce7194b55n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10385&group=comp.lang.xharbour#10385

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:620a:e0c:: with SMTP id y12mr19279320qkm.109.1639131074730;
Fri, 10 Dec 2021 02:11:14 -0800 (PST)
X-Received: by 2002:ac8:5702:: with SMTP id 2mr25485182qtw.473.1639131074519;
Fri, 10 Dec 2021 02:11:14 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Fri, 10 Dec 2021 02:11:14 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=80.151.237.2; posting-account=V7lAIgoAAAC3DUcIU4p9S6DraPJfG7Az
NNTP-Posting-Host: 80.151.237.2
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <88a624c5-8fea-4860-9a2b-725ce7194b55n@googlegroups.com>
Subject: convert color to rgb
From: inf...@hagl.de (Michael Hagl)
Injection-Date: Fri, 10 Dec 2021 10:11:14 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 7
 by: Michael Hagl - Fri, 10 Dec 2021 10:11 UTC

hi,
how can I convert a color value (1-255) to an RGB value?

I think I need an Array {{nColor, nRgbForegrundColor, nRgbBackgrundColor}} with 255 Lines. Im I right?

Thank you for some answers!

Michael Hagl

Re: convert color to rgb

<ae99cbde-8a01-4af4-a244-2e22b05269aan@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10387&group=comp.lang.xharbour#10387

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:ac8:7252:: with SMTP id l18mr28611079qtp.9.1639145572679;
Fri, 10 Dec 2021 06:12:52 -0800 (PST)
X-Received: by 2002:a05:620a:301:: with SMTP id s1mr20547230qkm.771.1639145572538;
Fri, 10 Dec 2021 06:12:52 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Fri, 10 Dec 2021 06:12:52 -0800 (PST)
In-Reply-To: <88a624c5-8fea-4860-9a2b-725ce7194b55n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=68.107.209.13; posting-account=7bF0GwoAAABMFHX6V4fON4-1F6LFJ834
NNTP-Posting-Host: 68.107.209.13
References: <88a624c5-8fea-4860-9a2b-725ce7194b55n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ae99cbde-8a01-4af4-a244-2e22b05269aan@googlegroups.com>
Subject: Re: convert color to rgb
From: dlz...@cox.net (dlzc)
Injection-Date: Fri, 10 Dec 2021 14:12:52 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 15
 by: dlzc - Fri, 10 Dec 2021 14:12 UTC

Good morning Michael:

On Friday, December 10, 2021 at 3:11:15 AM UTC-7, in...@hagl.de wrote:
> hi,
> how can I convert a color value (1-255) to an RGB value?
>
> I think I need an Array {{nColor, nRgbForegrundColor, nRgbBackgrundColor}} with 255 Lines. Im I right?
>
> Thank you for some answers!

https://www.dostips.com/forum/viewtopic.php?t=8493
.... your problem in reverse.

It is just math. You parse the bits, and make them the highest order bits of the appropriate color. You can make an array, if you do this a lot.

David A. Smith

Re: convert color to rgb

<e0478eee-de77-4412-a19d-1a2b71e714a6n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10393&group=comp.lang.xharbour#10393

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:620a:404e:: with SMTP id i14mr23012434qko.111.1639175797885;
Fri, 10 Dec 2021 14:36:37 -0800 (PST)
X-Received: by 2002:a05:6214:c2d:: with SMTP id a13mr28466724qvd.78.1639175797733;
Fri, 10 Dec 2021 14:36:37 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Fri, 10 Dec 2021 14:36:37 -0800 (PST)
In-Reply-To: <88a624c5-8fea-4860-9a2b-725ce7194b55n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=82.79.141.103; posting-account=H3ofRwoAAADbRxQ3Wi989fFKCMQ4Av_J
NNTP-Posting-Host: 82.79.141.103
References: <88a624c5-8fea-4860-9a2b-725ce7194b55n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e0478eee-de77-4412-a19d-1a2b71e714a6n@googlegroups.com>
Subject: Re: convert color to rgb
From: ellail...@gmail.com (Ella Stern)
Injection-Date: Fri, 10 Dec 2021 22:36:37 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 12
 by: Ella Stern - Fri, 10 Dec 2021 22:36 UTC

On Friday, December 10, 2021 at 12:11:15 PM UTC+2, in...@hagl.de wrote:
> hi,
> how can I convert a color value (1-255) to an RGB value?
>
> I think I need an Array {{nColor, nRgbForegrundColor, nRgbBackgrundColor}} with 255 Lines. Im I right?
>
> Thank you for some answers!
>
> Michael Hagl

In case of desktop apps the RGB value is an integer (on 4 bytes). The formula is described here (it does not include alpha channel):
https://math.stackexchange.com/questions/1635999/algorithm-to-convert-integer-to-3-variables-rgb
....but I don't understand what you need. If you are generating html files, the hexa color codes are simpler.

Re: convert color to rgb

<0ceaca54-1b62-4146-b71c-45957fe289e4n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10398&group=comp.lang.xharbour#10398

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:622a:1652:: with SMTP id y18mr44002226qtj.63.1639383925235;
Mon, 13 Dec 2021 00:25:25 -0800 (PST)
X-Received: by 2002:a05:622a:248:: with SMTP id c8mr42749341qtx.248.1639383925050;
Mon, 13 Dec 2021 00:25:25 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Mon, 13 Dec 2021 00:25:24 -0800 (PST)
In-Reply-To: <e0478eee-de77-4412-a19d-1a2b71e714a6n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.151.237.2; posting-account=V7lAIgoAAAC3DUcIU4p9S6DraPJfG7Az
NNTP-Posting-Host: 80.151.237.2
References: <88a624c5-8fea-4860-9a2b-725ce7194b55n@googlegroups.com> <e0478eee-de77-4412-a19d-1a2b71e714a6n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0ceaca54-1b62-4146-b71c-45957fe289e4n@googlegroups.com>
Subject: Re: convert color to rgb
From: inf...@hagl.de (Michael Hagl)
Injection-Date: Mon, 13 Dec 2021 08:25:25 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 20
 by: Michael Hagl - Mon, 13 Dec 2021 08:25 UTC

Hi Ella,

I need it for PageScript function PsTextOut()
Function PSTextOut(nTop, nLeft, xValue, cPicture, nJustify, cFontName, nFontSize, nFontStyle, nFontFColor, nFontBColor, nAngle)

nFontFColor, nFontBColor has to be RGB values. I want to convert Colorstring "b/n" t two RGB values.

Ella Stern schrieb am Freitag, 10. Dezember 2021 um 23:36:38 UTC+1:
> On Friday, December 10, 2021 at 12:11:15 PM UTC+2, wrote:
> > hi,
> > how can I convert a color value (1-255) to an RGB value?
> >
> > I think I need an Array {{nColor, nRgbForegrundColor, nRgbBackgrundColor}} with 255 Lines. Im I right?
> >
> > Thank you for some answers!
> >
> > Michael Hagl
> In case of desktop apps the RGB value is an integer (on 4 bytes). The formula is described here (it does not include alpha channel):
> https://math.stackexchange.com/questions/1635999/algorithm-to-convert-integer-to-3-variables-rgb
> ...but I don't understand what you need. If you are generating html files, the hexa color codes are simpler.

Re: convert color to rgb

<ac8a393e-db1d-463a-bb87-07b00a756fefn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10399&group=comp.lang.xharbour#10399

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:622a:4ce:: with SMTP id q14mr10297882qtx.627.1639395735231;
Mon, 13 Dec 2021 03:42:15 -0800 (PST)
X-Received: by 2002:ac8:7f89:: with SMTP id z9mr45813332qtj.15.1639395735075;
Mon, 13 Dec 2021 03:42:15 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Mon, 13 Dec 2021 03:42:14 -0800 (PST)
In-Reply-To: <0ceaca54-1b62-4146-b71c-45957fe289e4n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=106.215.104.49; posting-account=jZAeNwoAAABYWjMRM-FfqKkHfC3Iph0l
NNTP-Posting-Host: 106.215.104.49
References: <88a624c5-8fea-4860-9a2b-725ce7194b55n@googlegroups.com>
<e0478eee-de77-4412-a19d-1a2b71e714a6n@googlegroups.com> <0ceaca54-1b62-4146-b71c-45957fe289e4n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ac8a393e-db1d-463a-bb87-07b00a756fefn@googlegroups.com>
Subject: Re: convert color to rgb
From: timecost...@gmail.com (timepro timesheet)
Injection-Date: Mon, 13 Dec 2021 11:42:15 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 28
 by: timepro timesheet - Mon, 13 Dec 2021 11:42 UTC

On Monday, December 13, 2021 at 1:55:25 PM UTC+5:30, in...@hagl.de wrote:
> Hi Ella,
>
> I need it for PageScript function PsTextOut()
> Function PSTextOut(nTop, nLeft, xValue, cPicture, nJustify, cFontName, nFontSize, nFontStyle, nFontFColor, nFontBColor, nAngle)
>
> nFontFColor, nFontBColor has to be RGB values. I want to convert Colorstring "b/n" t two RGB values.
>
>
> Ella Stern schrieb am Freitag, 10. Dezember 2021 um 23:36:38 UTC+1:
> > On Friday, December 10, 2021 at 12:11:15 PM UTC+2, wrote:
> > > hi,
> > > how can I convert a color value (1-255) to an RGB value?
> > >
> > > I think I need an Array {{nColor, nRgbForegrundColor, nRgbBackgrundColor}} with 255 Lines. Im I right?
> > >
> > > Thank you for some answers!
> > >
> > > Michael Hagl
> > In case of desktop apps the RGB value is an integer (on 4 bytes). The formula is described here (it does not include alpha channel):
> > https://math.stackexchange.com/questions/1635999/algorithm-to-convert-integer-to-3-variables-rgb
> > ...but I don't understand what you need. If you are generating html files, the hexa color codes are simpler.

i simply use this, works ok:
xnb=rgb(0,0,128) - navy blue
xw=rgb(255,255,255) - white
pssetfont(fontname,fontstyle,fontsize,xnb,xw)
pstextout(xx,yy,'blah blah...')
....

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor