Autor Tema: rgb()  (Leído 1237 veces)

Sandman

  • Sr. Member
  • ****
  • Mensajes: 298
  • Karma: 48
rgb()
« en: Noviembre 17, 2008, 09:22:24 pm »
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