Thread: HTML - Color generator thingy

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    38

    HTML - Color generator thingy

    I used to have a small program that would show colors and codes. Does anyone know of where I could find one?

    Like this, only portable.
    http://www.visibone.com/colorlab/
    Last edited by MB1; 11-01-2005 at 02:21 PM.

  2. #2
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    On your browsers menu:

    File > Save As...

    It will save all the files needed to run that webpage onto disk.

  3. #3
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    this is a recreation of something I made a long time ago... I think I was just fascinated by the fact that some code only exists to generate more code for something else... in this case, HTML for a browser... this was back when I was just getting into PHP... anyway, it's free for your use, and should be fully portable... even though it's not what you want

    Code:
    #include <iostream>
    #include <iomanip>
    
    inline void output(const int R, const int G, const int B);
    
    int main()
    {
    	int R=0x0;
    	int G=0x0;
    	int B=0x0;
    
    	std::cout<<"<html><head><title>COLORS!!!</title></head><body><table>";
    
    	for(R=0x0;R<=0xF;R+=0x1)
    	{
    		for(G=0x0;G<=0xF;G+=0x1)
    		{
    			std::cout<<"<tr>";
    			for(B=0x0;B<=0xF;B+=0x1)
    			{
    				output(R,G,B);
    			}
    			std::cout<<"</tr>";
    		}
    	}
    
    	std::cout<<"</table></body></html>"<<std::flush;
    
    	return 0;
    	
    }
    
    inline void output(const int R, const int G, const int B)
    {
    	std::cout<<"<td bgcolor=\"#"<<std::hex<<std::uppercase
    "		<<R<<R<<G<<G<<B<<B<<"\">"<<R<<R<<G<<G<<B<<B<<"</td>";
    "}
    edit: I VERY strongly urge you to pipe that out to a file, rather than just running the program... it outputs 135KB >.<
    Last edited by major_small; 11-01-2005 at 09:08 PM.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    You're code formatter isn't working properly:
    Code:
    std::cout<<"<td bgcolor=\"#"<<std::hex<<std::uppercase
    My code formatter doesn't do that.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    Quote Originally Posted by dwks
    You're code formatter isn't working properly:
    Code:
    std::cout<<"<td bgcolor=\"#"<<std::hex<<std::uppercase
    My code formatter doesn't do that.
    yeah I knokw... I'm just too lazy to fix that =P
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Please Help - C code creates dynamic HTML
    By Christie2008 in forum C Programming
    Replies: 19
    Last Post: 04-02-2008, 07:36 PM
  2. Writing an HTML Preprocessor
    By thetinman in forum C++ Programming
    Replies: 1
    Last Post: 09-17-2007, 08:01 AM
  3. regarding html in c
    By cnu_sree in forum C Programming
    Replies: 19
    Last Post: 06-25-2007, 03:22 AM
  4. Design + HTML
    By orbitz in forum C Programming
    Replies: 8
    Last Post: 11-21-2002, 06:32 AM