• convert color to rgb

    From Michael Hagl@21:1/5 to All on Fri Dec 10 02:11:14 2021
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dlzc@21:1/5 to in...@hagl.de on Fri Dec 10 06:12:52 2021
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ella Stern@21:1/5 to in...@hagl.de on Fri Dec 10 14:36:37 2021
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael Hagl@21:1/5 to Ella Stern on Mon Dec 13 00:25:24 2021
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From timepro timesheet@21:1/5 to in...@hagl.de on Mon Dec 13 03:42:14 2021
    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...')
    ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)