Konsole: Color schemes?

If you enter setting on the Konsole menu, it gives you the option to edit the current profile, and you can also
create new ones. When you enter the appearance tab, there are a number of color schemes to choose from:
and there are 20 “colors” , Background/Foreground and 8 numbered each in two categories, “Normal” and “Intense”
How are these mapped, where are the mapping files to be found. Reason, I like to change the colors, and always
end up spending time trying to figure out what color goes to what “code”. Example; when the “if” word in a sh script
turns out to be yellow on white your eyes get tired very quickly, or a pastel blue cursor on top of a pair of blue “{}”
can drive you totally crazy. And of course, change to a perl script, well you get the idea.

Any help appreciated!

frankeG

I am not sure I understand your question. An application like Konsole allows you to change the default colors and any terminal application you run could change that to something else as well. While you have control of the default, you may not have control of a CLI application and there is little you can do about it except change the source code I suppose. As an example of how to set colors in a bash script, take a look at this function block:

# *****************************************************************************
# Do you want to see sact in color? The default is true, but can be set  
# to false - New Escape Sequences works without a Desktop loaded 
# *****************************************************************************

use_color=true

# *****************************************************************************
# Color Display Request - color forground background ** 
#              Called from more than 10 locations in program
#
# 0:Black  1:Blue  2:Green  3:Cyan  4:Red  5:Magenta  6:Yellow  7:White
#
# Example: **color 7 0 B **
#
# where forground is white (7), backgroud is black (0) and text is in bold (B)
#                          $1                      $2                      $3
# *****************************************************************************

function color {
  if $use_color ; then
    if  $3 == [Nn] ]] ; then
      tput sgr0
    fi
    if  $3 == [Bb] ]] ; then
      case "$1" in
        "0") echo -ne '\E1;30m' ;;
        "1") echo -ne '\E1;34m' ;;
        "2") echo -ne '\E1;32m' ;;
        "3") echo -ne '\E1;36m' ;;
        "4") echo -ne '\E1;31m' ;;
        "5") echo -ne '\E1;35m' ;;
        "6") echo -ne '\E1;33m' ;;
        "7") echo -ne '\E1;37m' ;;
        *) echo -ne '\E1;37m' ;;
      esac
    else
      case "$1" in
        "0") echo -ne '\E30m' ;;
        "1") echo -ne '\E34m' ;;
        "2") echo -ne '\E32m' ;;
        "3") echo -ne '\E36m' ;;
        "4") echo -ne '\E31m' ;;
        "5") echo -ne '\E35m' ;;
        "6") echo -ne '\E33m' ;;
        "7") echo -ne '\E37m' ;;
        *) echo -ne '\E37m' ;;
      esac
    fi
    case "$2" in
      "0") echo -ne '\E40m' ;;
      "1") echo -ne '\E44m' ;;
      "2") echo -ne '\E42m' ;;
      "3") echo -ne '\E46m' ;;
      "4") echo -ne '\E41m' ;;
      "5") echo -ne '\E45m' ;;
      "6") echo -ne '\E43m' ;;
      "7") echo -ne '\E47m' ;;
      *) echo -ne '\E40m' ;;
    esac
  else
    echo -ne '\E37;40m' 
  fi
  return 0
}


Thank You,**

Thank you, James, I will play with the script you included to get more acquainted with colors;
but,
Put another way, and using the Konsole reference:
open Konsole, select “Settings” from the menubar, then
“Edit current profile” from the drop-down,
and click the “Appearance” tab from the panel presented
list of “Color Schemes & Backgrounds” appears.
Select any one, a pop-up appears
(it gives the list of the current 20 colors used by the selected scheme.)
As you point out, you can change any of them. What I want to know is where is the file(s) that contain
the original and your changed selections?
My interest is piqued by the fact that vi, for example, applies the colors to anything you type much like
an IDE, Komodo as example, does; without satisfactory results.

Sincerely,
Frank G
Can you clarify my lack of knowledge, what is “CLI”?

Colorschemes are saved as *.colorscheme files. Edited ones locate in: “~/.kde[4]/share/apps/konsole/” and default ones in “/usr/share/kde4/apps/konsole/” at least in openSUSE.