# Class ColorfulCircle

Base class of every drawable object.

To create your own drawables, you need to subclass from this.

> Although lights are also subclasses of Drawable, you cannot create your own light sources.

#### Hierarchy (View Summary)

- Drawable
  - ColorfulCircle

- Defined in drawables/shapes/colorful-circle.ts:5

##### Index

### Constructors

constructor

### Properties

center
colorIndex
radius
descriptor

### Methods

getObjectToSerialize
minDistance

## Constructors

### constructor

- new ColorfulCircle(
  center: vec2,
  radius: number,
  colorIndex: number,
  ): ColorfulCircle

  #### Parameters

  - center: vec2
  - radius: number
  - colorIndex: number

  #### Returns ColorfulCircle

  Overrides Drawable.constructor

  - Defined in drawables/shapes/colorful-circle.ts:38

## Properties

### center

center: vec2

- Defined in drawables/shapes/colorful-circle.ts:39

### colorIndex

colorIndex: number

- Defined in drawables/shapes/colorful-circle.ts:41

### radius

radius: number

- Defined in drawables/shapes/colorful-circle.ts:40

### `Static` descriptor

descriptor: DrawableDescriptor = ...

This should be defined in inherited classes.

Overrides Drawable.descriptor

- Defined in drawables/shapes/colorful-circle.ts:6

## Methods

### `Protected` getObjectToSerialize

- getObjectToSerialize(transform2d: mat2d, transform1d: number): any

  Return the values that should be given to the shaders through uniform inputs.

  #### Parameters

  - transform2d: mat2d

    position-like properties should be transformed by this matrix before being returned.

  - transform1d: number

    scalar properties should be transformed by this number before being returned.

  #### Returns any

  Overrides Drawable.getObjectToSerialize

  - Defined in drawables/shapes/colorful-circle.ts:50

### minDistance

- minDistance(target: vec2): number

  The lower bound of the distance between the target and the object.

  It can return 0 by default; the only consequence is reduced performance, because this object won't benefit from tile-based rendering.

  #### Parameters

  - target: vec2

  #### Returns number

  Overrides Drawable.minDistance

  - Defined in drawables/shapes/colorful-circle.ts:46