Experiments

bubbles

Random Bubble Generator

The Random Bubbles Generator creates a image consisting of 16,000 circles of random sizes and colors, placed in random positions inside a circle.
Utilizes PHP GD Library for image creation.
Challenges: A randomly generated integer was used to represent one of the 16 Million possible colors in the 24-bit web color space. This integer must then be converted to an equivalent RGB color. Solution: Convert interger to a 6-digit hex number, then split the hex number into 3 consecutive pairs (e.g. hex # 130099 becomes 13, 00, 99) and then convert each hex pair back into integers (19, 0, 153), this becomes the RGB values.