Main Menu

rgb()

Started by Sandman, November 17, 2008, 09:22:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Sandman

I'd like functions that return a colorcode for a specific depth.

For example, I have an 8-bit graphic in a 16-bit environment. Now I cannot make use of rgb() for this graphic, because the returned colorcodes are for 16-bit.

Possible suggestions:

  • Addition of rgbX() functions, where X equals 'bitdepth of wanted colourcode'
    Meaning: rgb8(), rgb16(), rgb32(), rgba8(), rgba16(), rgba32()
  • Addition of an optional parameter to both rgb() and rgba(): desired bitdepth of returned colourcode.
    Meaning: rgb(r,g,b,[depth]) and rgba(r,g,b,a,[depth])

Personally I like the second one much better than the first one, as it is easier to use it with graphics with a variable bitdepth (depending on other factors).
-- Sandman