Custom RGB colors


Re: Custom RGB colors
#4
In addition to the link Philo already provided, below is info from comments in my LDView source code. Note that I didn't create any of these color schemes; I simply coded LDView to recognize them.

Code:
// 0x2RRGGBB = opaque RGB
// 0x3RRGGBB = transparent RGB
// 0x4RGBRGB = opaque dither
// 0x5RGBxxx = transparent dither (xxx is ignored)
// 0x6xxxRGB = transparent dither (xxx is ignored)
// 0x7xxxxxx = invisible

Notes:
  • In all of the above, "x" indicates a hex digit that is completely ignored.
  • 0x3RRGGBB are ostensibly 50% opaque, but they are intended to represent transparent (translucent, really) bricks, so 50% isn't necessarily an appropriate degree of opacity.
  • The dither pattern used when the above "dither" colors were created was a 50/50 checkerboard.
  • Combining two 12-bit colors together in a 50/50 checkerboard does not give you a 24 bits of color space.
  • LDView does not use a checkerboard dither pattern. It instead averages the two input colors together (after converting them from 12 bits each to 24 bits each by multiplying each 4-bit component of the 12-bit number by 17 and then placing the result in the appropriate spot in the 24-bit number).
  • For 0x4xxxxxx-0x7xxxxxx colors, the bottom two bits of the 4, 5, 6, and 7 can be interpreted as "ignore this part of the dither and treat it as transparent".
I suspect that the reason that the 0x4xxxxxx-0x6xxxxxx range isn't document on ldraw.org is because they don't make any sense on modern computers, and we basically don't want them to be used. I'm not sure if 0x7xxxxxx is documented or not. On the surface it seems useless, but I know somebody at some point asked me legitimately if there was any way to have an invisible color, and I told them about that color.

Note that I believe that if you manually enter the integer value from one of the 0x2RRGGBB or 0x3RRGGBB colors into MLCad, it will display it in the right color. (In other words, calculate the big integer value, and then enter that into the color number box, instead of entering R, G, and B.) I could be wrong about this, though.
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Custom RGB colors - by Stephen - 2014-02-20, 13:06
Re: Custom RGB colors - by Philippe Hurbain - 2014-02-20, 13:39
Re: Custom RGB colors - by Stephen - 2014-02-20, 13:53
Re: Custom RGB colors - by Travis Cobbs - 2014-02-20, 19:02
Re: Custom RGB colors - by Stephen - 2014-02-20, 20:11
Re: Custom RGB colors - by Michael Heidemann - 2014-02-20, 21:10
Re: Custom RGB colors - by Travis Cobbs - 2014-02-20, 22:05
Re: Custom RGB colors - by Michael Heidemann - 2014-02-21, 16:55
Re: Custom RGB colors - by Travis Cobbs - 2014-02-21, 21:41
Re: Custom RGB colors - by Tim Gould - 2014-02-21, 22:43
Re: Custom RGB colors - by Travis Cobbs - 2014-02-22, 0:01
Re: Custom RGB colors - by Travis Cobbs - 2014-05-02, 16:44
Re: Custom RGB colors - by Michael Heidemann - 2014-05-02, 17:02
Re: Custom RGB colors - by Michael Heidemann - 2014-05-02, 11:10

Forum Jump:


Users browsing this thread: 2 Guest(s)