GUI Textures & Colours - snoplus/snogoggles GitHub Wiki

Image files

The two images files ~A.png and ~B.png (where ~ is replaced by the user choice). Defines the image shape via the texture definition. These images should contain the

Texture Definition

Each GUI texture is made of 6 colours (a,b,c,d,e,f) and a background, with the shape sum defined by two RGBA bitmap files. The file channels are referred to as:

  1. Base (red image 1)
  2. Highlight (green image 1)
  3. Border (blue image 1)
  4. Transparency of image (alpha image 1)
  5. Base Shadow (red image 2)
  6. Highlight shadow (green image 2)
  7. Border shadow (blue image 2)
  8. Transparency of image 2 (alpha image 2)

The total colour of a pixel is then the sum

r,g,b = g + ([1]/255*a + [2]/255*b + [3]/255*c) + ([5]/255*d + [6]/255*e + [7]/255*f)*[8]/255
alpha = [4]/255

Where the number in [] is the bitmap channel.

Colour Definition

Each of the six colours will change depending on the state of which there are, base, highlight and active. Hence for a gui colour palette 18 colours need to be defined, plus one background colour g. NB: If a texture should be absent of colour f, for example, channel 7 should equal 0.