Coder Social home page Coder Social logo

fractalgen's Introduction

FractalGen

2 programs i wrote that generate fractals

Compile it using:

gcc -o main mandelbrot.c -lm -lSDL

Replace madelbrot.c with julia.c depending on which one you want to generate.

The controls are:

Up: Up arrow
Down: Down arrow
Left: Left Arrow
Right: Right Arrow

Zoom in: Z
Zoom Out: X

To change the iterations/quality of the set generate modify the MAXCOUNT definitions at the top of the file. Change the resolution by modifying the WIDTH and HEIGHT definitions.

Change the colors of the set by adding or removing colors from this, the colors can be any amount. It uses the RGBA format the alpha doesnt matter.

SDL_Color palette[] = {
    {  10,  15,  20, 255 }, // Dark blue-gray
    {  20,  30,  40, 255 }, // Deep blue-gray
    {  30,  45,  60, 255 }, // Blue-gray
    {  40,  60,  80, 255 }, // Medium blue-gray
    {  50,  75, 100, 255 }, // Light blue-gray
    {  60,  90, 120, 255 }, // Bright blue-gray
    {  70, 105, 140, 255 }, // Pale blue-gray
    {  80, 120, 160, 255 }, // Gray-blue
    {  90, 135, 180, 255 }, // Blue
    { 100, 150, 200, 255 }, // Light blue
    { 110, 165, 220, 255 }, // Powder blue
    { 120, 180, 240, 255 }, // Sky blue
    { 130, 195, 255, 255 }, // Light sky blue
    { 140, 210, 255, 255 }, // Pale blue
    { 150, 225, 255, 255 }, // Baby blue
    { 160, 240, 255, 255 }, // Ice blue
    { 170, 255, 255, 255 }, // Light cyan
    { 200, 255, 255, 255 }, // Cyan
    { 230, 255, 255, 255 }, // Pale cyan
    { 255, 255, 255, 255 }, // White
    { 220, 220, 220, 255 }, // Light gray
    { 200, 200, 200, 255 }, // Gray
    { 180, 180, 180, 255 }, // Dark gray
    { 150, 150, 150, 255 }, // Charcoal
    { 120, 120, 120, 255 }, // Dark charcoal
    {  90,  90,  90, 255 }, // Black
    {  50,  75, 100, 255 }, // Blue-gray (repeat)
};

fractalgen's People

Contributors

mythstik avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.