Like Tree1Likes
  • 1 Post By c99tutorial

How to increase Colors(More Colors)?

This is a discussion on How to increase Colors(More Colors)? within the C Programming forums, part of the General Programming Boards category; Hello, In C, using graphics.h, I can only deal with limited number of colors like setcolor(int) is there another way ...

  1. #1
    Registered User
    Join Date
    Nov 2012
    Posts
    54

    How to increase Colors(More Colors)?

    Hello,

    In C, using graphics.h, I can only deal with limited number of colors
    like
    setcolor(int)

    is there another way to extend or another source or header file which provide more colors?

  2. #2
    Registered User
    Join Date
    Nov 2012
    Posts
    1,098
    This header is from Borland's BGI graphics library, which is old and probably unsupported. I found this thread on this same forum with more info:

    graphics.h under Turbo C

    Anyway, to accomplish your goal (more colors), I would use a different library. Unless you're programming a DOS game to be played on classic computers.

    Cross-platform GUI Library examples:
    Qt
    GTK

    Cross-platform game Library examples:
    SDL
    Allegro

    Search those keywords for more information.

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,535
    > In C, using graphics.h, I can only deal with limited number of colors
    If you persist in programming using a DOS compiler, then you're always going to be stuck with the 16/256 colours that DOS could ever deal with.

    Use a modern compiler, for your modern OS, which can make the best use of your modern graphics card.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Registered User
    Join Date
    Nov 2012
    Posts
    54
    im using c++ 3.0 compiler with XP.
    Is this not enough?
    I need resources like objects, codes or header files to improve colors. Is it possible?How?

  5. #5
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,681
    If you want really do something good, upgrade to C++ and use Direct X or openGl
    Code - functions and small libraries I use


    It’s 2014 and I still use printf() for debugging.


    "Programs must be written for people to read, and only incidentally for machines to execute. " —Harold Abelson

  6. #6
    Registered User
    Join Date
    May 2010
    Posts
    2,753
    im using c++ 3.0 compiler with XP.
    Is this not enough?
    No, that compiler is very old and only produces DOS programs. You need to find a more recent compiler if you want more colors.

    Jim

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Relation between material colors and light colors.
    By indigo0086 in forum Game Programming
    Replies: 3
    Last Post: 04-18-2007, 03:20 PM
  2. colors in forefox and colors in IE
    By MisterSako in forum Tech Board
    Replies: 3
    Last Post: 05-15-2006, 01:59 PM
  3. colors
    By volk in forum C++ Programming
    Replies: 7
    Last Post: 03-16-2003, 07:11 PM
  4. colors (yes again)
    By Klinerr1 in forum C++ Programming
    Replies: 10
    Last Post: 07-18-2002, 08:01 PM
  5. colors (again)
    By Klinerr1 in forum C++ Programming
    Replies: 6
    Last Post: 07-14-2002, 09:37 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21