Skip to content
/ Fadey Public

✨ Your best friend when it comes to making your output beautiful ✨

License

Notifications You must be signed in to change notification settings

K1ngmar/Fadey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Really cool fadey banner

🌈 Fadey

✨ Your best friend when it comes to making your output beautiful ✨

📦 Content:

📝 About:

Fadey will make your output into rainbows °˖✧◝(⁰▿⁰)◜✧˖°

📋 Requirements:

This project uses ANSI 256 colors module

# install ansi 256 color module:
$ npm install --save ansi-256-colors

⚙️ Installation:

# Clone:
$ git clone https://github.com/K1ngmar/Fadey.git

# Compile:
$ make -C Fadey/

By running MAKE in this repository it will create a static library called libfadey.a.
The header is located at {install_dir}/Fadey/includes/fadey.hpp

/Fadey/
├── includes/
│   └── fadey.hpp
├── libfadey.a
├── Makefile
└── ...

✅ Features:

Everything is in the namespace km
Be aware that Fadey calls srand(time(NULL)); once before main gets called!

  • A global named fadey with std::cout as output stream

  • The fade will continue across calls if auto reset is set to false

    // example:
    for (size_t i = 0; i < 42; i++)
      km::fadey << "The fade continues across calls :O" << std::endl;

    note that if you have a lot of difference in line length it will work best if you pass them as a single string

    Really cool fadey banner
  • A constructor with auto reset turned off by default and an output stream set to std::cout by default

    // prototype:
    Fadey(bool auto_reset = false, std::ostream& stream = std::cout);
  • Fade pattern starts at a random position by default

  • Fadify function, that will turn your string into a rainbow

    // prototype:
    std::string fadify(std::string to_fade);
    
    // used like:
    std::string faded = km::fadey.fadify("I am about to get faded");
  • An output stream for strings that will fadify the string ánd write it to stream

    // prototype:
    std::ostream& operator << (Fadey&, std::string);
    
    // used like:
    km::fadey << "This is going to be faded :D" << std::endl;
  • An auto reset feature which will reset the fade patern to its original state every time

    • A function to turn auto reset on and/or off

      // prototype:
      void	set_auto_reset(bool auto_reset);
      
      // used like:
      km::fadey.set_auto_reset(true);  // turn auto reset on
      km::fadey.set_auto_reset(false); // turn auto reset off
    • Toggle auto reset

      // prototype:
      void  toggle_auto_reset(void);
      
      // used like:
      km::fadey.toggle_auto_reset();

      note that if you turn auto reset on the fade pattern will instantly be reset to its starting state

  • New seed

    // prototype:
    void	new_seed();
    
    // used like:
    km::fadey.new_seed();

    note that this will not call srand();

❗️ Performance:

Currently Fadey is very slow, I would NOT recommend using it if speed is important

💖 Shoutout:

Big love to the boys:

About

✨ Your best friend when it comes to making your output beautiful ✨

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published