Skip to content

# `fgColor`

## fontgate.fgColor = class fgColor(object)

      Color representation

      Constructors:  fgColor() - default
        fgColor(fgColor) - copy
        fgColor(float hueValue) - by hue value  fgColor(r, g, b) - by r, g, b, float values from 0 to 1.0
        fgColor(r, g, b, a) - by r, g, b, a float values from 0 to 1.0

#### Methods

A(...)

      int A() - get alpha value as int (0..255)

B(...)

      int B() - get blue value as int (0..255)

G(...)

      int G() - get green value as int (0..255)

R(...)

      int B() - get blue value as int (0..255)

__add__(...)

      x.__add__(y) <==> x+y

__delattr__(...)

      x.__delattr__('name') <==> del x.name

__delitem__(...)

      x.__delitem__(y) <==> del x[y]

__delslice__(...)

      x.__delslice__(i, j) <==> del x[i:j]

      Use of negative indices is not supported.

__eq__(...)

      x.__eq__(y) <==> x==y

__ge__(...)

      x.__ge__(y) <==> x>=y

__getattribute__(...)

      x.__getattribute__('name') <==> x.name

__getitem__(...)

      x.__getitem__(y) <==> x[y]

__getslice__(...)

      x.__getslice__(i, j) <==> x[i:j]

      Use of negative indices is not supported.

__gt__(...)

      x.__gt__(y) <==> x>y

__init__(...)

      x.__init__(...) initializes x; see help(type(x)) for signature

__le__(...)

      x.__le__(y) <==> x<=y

__len__(...)

      x.__len__() <==> len(x)

__lt__(...)

      x.__lt__(y) <==> x

__mul__(...)

      x.__mul__(n) <==> x*n

__ne__(...)

      x.__ne__(y) <==> x!=y

__repr__(...)

      x.__repr__() <==> repr(x)

__rmul__(...)

      x.__rmul__(n) <==> n*x

__setattr__(...)

      x.__setattr__('name', value) <==> x.name = value

__setitem__(...)

      x.__setitem__(i, y) <==> x[i]=y

__setslice__(...)

      x.__setslice__(i, j, y) <==> x[i:j]=y

      Use  of negative indices is not supported.

__str__(...)

      x.__str__() <==> str(x)

asDict(...)

      represent object as dictionary

asTuple(...)

      represent object as tuple

getCMYK(...)

      (c, m, y, k, a) getCMYK([varK = 0.3]) - get color as CMYK+A components

gray(...)

      float gray() - get color as grayscale level

hue(...)

      float hue() - get hue value

lab(...)

      (l, a, b) lab() - get color as lab float values

lightness(...)

      float lightness() - get lightness value

saturation(...)

      float saturation() - get saturation value

set(...)

      set((r, g, b[, a])) - set color by tuple with rgb or rgba float values

setCMYK(...)

      setCMYK(c, m, y, k[, _a = 1.0]) = set color by CMYK[A] float values

setGray(...)

      segGray(float v) - set rgb components to v

setHue(...)

      setHue(h[, s=1.0[, l = 0.5]]) - set by hsl float values

xyz(...)

      (x, y, z) xyz() - get color as xyz float values

#### Static methods

black(...)

      fgColor black() - get black color

fromInt(...)

      fgColor fromInt(r, g, b[, a=255]) - get color by int rgb(a) values (0..255)

fromLab(...)

      fgColor fromLab(l, a, b) - get color by float lab values

transparent(...)

      fgColor transparent() - get transparent color

#### Descriptors

a

      (float 0..1.0) - alpha channel

b

      (float 0..1.0) - blue channel

g

      (float 0..1.0) - green channel

r

      (float 0..1.0) - red channel

#### Attributes

__new__ = <built-in method __new__ of type object>

      T.__new__(S, ...) -> a new object with type S, a subtype of T

## `A`

fontgate.fgColor.A = A(...)

      int A() - get alpha value as int (0..255)

## `a`

fontgate.fgColor.a

      (float 0..1.0) - alpha channel

## `asDict`

fontgate.fgColor.asDict = asDict(...)

      represent object as dictionary

## `asTuple`

fontgate.fgColor.asTuple = asTuple(...)

      represent object as tuple

## `B`

fontgate.fgColor.B = B(...)

      int B() - get blue value as int (0..255)

## `b`

fontgate.fgColor.b

      (float 0..1.0) - blue channel

## `black`

fontgate.fgColor.black = black(...)

      fgColor black() - get black color

## `fromInt`

fontgate.fgColor.fromInt = fromInt(...)

      fgColor fromInt(r, g, b[, a=255]) - get color by int rgb(a) values (0..255)

## `fromLab`

fontgate.fgColor.fromLab = fromLab(...)

      fgColor fromLab(l, a, b) - get color by float lab values

## `G`

fontgate.fgColor.G = G(...)

      int G() - get green value as int (0..255)

## `g`

fontgate.fgColor.g

      (float 0..1.0) - green channel

## `getCMYK`

fontgate.fgColor.getCMYK = getCMYK(...)

      (c, m, y, k, a) getCMYK([varK = 0.3]) - get color as CMYK+A components

## `gray`

fontgate.fgColor.gray = gray(...)

      float gray() - get color as grayscale level

## `hue`

fontgate.fgColor.hue = hue(...)

      float hue() - get hue value

## `lab`

fontgate.fgColor.lab = lab(...)

      (l, a, b) lab() - get color as lab float values

## `lightness`

fontgate.fgColor.lightness = lightness(...)

      float lightness() - get lightness value

## `R`

fontgate.fgColor.R = R(...)

      int B() - get blue value as int (0..255)

## `r`

fontgate.fgColor.r

      (float 0..1.0) - red channel

## `saturation`

fontgate.fgColor.saturation = saturation(...)

      float saturation() - get saturation value

## `set`

fontgate.fgColor.set = set(...)

      set((r, g, b[, a])) - set color by tuple with rgb or rgba float values

## `setCMYK`

fontgate.fgColor.setCMYK = setCMYK(...)

      setCMYK(c, m, y, k[, _a = 1.0]) = set color by CMYK[A] float values

## `setGray`

fontgate.fgColor.setGray = setGray(...)

      segGray(float v) - set rgb components to v

## `setHue`

fontgate.fgColor.setHue = setHue(...)

      setHue(h[, s=1.0[, l = 0.5]]) - set by hsl float values

## `transparent`

fontgate.fgColor.transparent = transparent(...)

      fgColor transparent() - get transparent color

## `xyz`

fontgate.fgColor.xyz = xyz(...)

      (x, y, z) xyz() - get color as xyz float values