// View pixel EMs, Precent, Point sizes for HTML
// Date 22:50 15/12/2016
// By Ben a.k.a DreamVB

#include <Windows.h>
#include <iostream>
#include <iomanip>

using namespace std;
using std::cout;
using std::endl;

void ColorFont(WORD color){
	HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
	SetConsoleTextAttribute(hConsole, color);
}

void Caption(){
	//Set caption font color
	ColorFont(31);
	//Set caption text
	cout << "--- Pixel to em calulator ---\n\n";
	//Restore font color.
	ColorFont(15);
}

int main(int argc, char *argv[]){
	int basePixel = 16;

	ColorFont(31);
	cout << "Pixels\tEMs\t   Percent\tPoints\n";
	ColorFont(15);

	for (double i = 6; i < 25; i++){
		cout << ((int)i) << "px\t" << std::fixed << std::setprecision(3) 
			<< (i / basePixel) << "em\t   " << std::setprecision(1) 
			<< ((i/basePixel)*100) << "%\t" << (int)(i*.75) << "pt" << endl;
	}

	//Pause program
	system("pause");
	return EXIT_SUCCESS;
}