Forum > FV/Textmode IDE

(Syntax) Color Selection

(1/2) > >>

skalogryz:
Is it true that syntax highlight color selection has never been implemented?

I'm looking at ColorSel dialog (that seems as an attempt to implement the dialog) and after some code modifications it's as far as it goes (see the attached image).

The menu for "Colors" has been commented out since 2006 (r3479)

marcov:
What I remember about it:

Afaik it colorsel was found to be based on a TP version and removed/disabled.

I added some prototypes from a C++ version, and had contact for a while with sb who wanted to improve it. That contact dried  up, and that's about it.

skalogryz:
hey marcov, thank you for the answer.
From the top of your head (since I've not had a chance to look into the code myself yet), do you know if colors are fully read from .ini file?
optionally, a user could just fill the .ini manually and it works (no need to change colors in run-time).

if yes, what how to populate the colors "array" in .ini file?

It's definitely not the key/value reading .
(fpini.pas)

--- Code: ---  { Colors }
  S:=AppPalette;
  PS:=StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_1_40',PaletteToStr(copy(S,1,40))));
  PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_41_80',PaletteToStr(copy(S,41,40))));
  PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_81_120',PaletteToStr(copy(S,81,40))));
  PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_121_160',PaletteToStr(copy(S,121,40))));
  PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_161_200',PaletteToStr(copy(S,161,40))));
  PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_201_240',PaletteToStr(copy(S,201,40))));
  if length(PS)<length(CIDEAppColor) then
    PS:=PS+copy(CIDEAppColor,length(PS)+1,255);
  AppPalette:=PS;


--- End code ---

skalogryz:
alright. FP IDE text editor font colors start at palette index 199. The most wanted are located starting at 201.
Adding such line to fp.ini file

--- Code: ---[Colors]
Palette_201_240=#$17#$1F#$1E#$1B#$1A#$1A#$1E#$71#$3F#$30#$1C#$1A#$1F#$4E#$31#$3F#$3A#$31#$31#$31#$71#$1F#$31#$2F#$3E#$3F#$70#$20#$FF#$3A#$37#$FF#$FF#$FF

--- End code ---
changes the color of numbers from cyan to light green (lime).

skiy1337lazarus:
I did file a bug report about that. Hope the default gets changed. (Blue is too dark for numbers)

Navigation

[0] Message Index

[#] Next page

Go to full version