Zebra API Doc

zebra.util.rgb Class

Rgb color class. This class represents rgb(a) color as JavaScript structure:

  // rgb color
  var rgb1 = new zebra.util.rgb(100,200,100);

  // rgb with transparency 
  var rgb2 = new zebra.util.rgb(100,200,100, 0.6);

  // encoded as a string rgb color
  var rgb3 = new zebra.util.rgb("rgb(100,100,200)");

  // hex rgb color
  var rgb3 = new zebra.util.rgb("#CCDDFF");

Constructor

zebra.util.rgb

(
  • r
  • [g]
  • [b]
  • [a]
)

Parameters:

  • r Integer | String

    red color intensity or if this is the only constructor parameter it denotes encoded in string rgb color

  • [g] Integer optional

    green color intensity

  • [b] Integer optional

    blue color intensity

  • [a] Float optional

    alpha color intensity

Item Index

Attributes

Attributes

a

Float readonly

Alpha

b

Integer readonly

Blue color intensity

g

Integer readonly

Green color intensity

isTransparent

Boolean readonly

Indicates if the color is opaque

r

Integer readonly

Red color intensity