Class zebkit.draw.rgb
extends <zebkit.draw.View>

RGB color class. This class represents a rgb color as JavaScript structure:

// rgb color
var rgb1 = new zebkit.draw.rgb(100,200,100);

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

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

// hex rgb color
var rgb3 = new zebkit.draw.rgb("#CCDDFF");
zebkit.draw.rgb (r, [g], [b], [a])

  • r <Integer | String>

    the meaning of the argument depends on number of arguments the constructor gets:

    • If constructor gets only this argument the argument is considered as encoded rgb color:
      • String means its hex encoded ("#CCFFDD") or rgb ("rgb(100,10,122)", "rgba(100,33,33,0.6)") encoded color
      • Integer means this is number encoded rgb color
    • Otherwise the argument is an integer value that depicts a red intensity of rgb color

    encoded in string rgb color

  • [g] <Integer>

    green color intensity

  • [b] <Integer>

    blue color intensity

  • [a] <Float>

    alpha color intensity

public <Float> a


public <Integer> b

Blue color intensity

public <zebkit.draw.rgb> black

Black color constant

public <Integer> g

Green color intensity

public <Boolean> isOpaque

Indicates if the color is opaque

public <Integer> r

Red color intensity