How to solve: E254: Cannot allocate color darkyellow

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

How to solve: E254: Cannot allocate color darkyellow

Alan Schmitt
Hello,

I've been having this problem for a while, and I would like to solve
it. Using some syntax hilighters, I keep getting the error: E254:
Cannot allocate color darkyellow

I looked at the help for that error, but I could not find how to solve
it. Any suggestion? I'm using ViM 6.3 for OS X (gvim version). The
strange thing is that everything works when I use vim in the terminal,
and not gvim.

Alan

PGP.sig (193 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to solve: E254: Cannot allocate color darkyellow

Bram Moolenaar

Alan Schmitt wrote:

> I've been having this problem for a while, and I would like to solve
> it. Using some syntax hilighters, I keep getting the error: E254:
> Cannot allocate color darkyellow
>
> I looked at the help for that error, but I could not find how to solve
> it. Any suggestion? I'm using ViM 6.3 for OS X (gvim version). The
> strange thing is that everything works when I use vim in the terminal,
> and not gvim.

The problem is that the GUI doesn't know the color DarkYellow, although
it should (it's a standard color).

If you have a ":colorscheme" command, avoid it, or if you see the
DarkYellow color used somewhere replace it with "#BBBB00".

--
Those who live by the sword get shot by those who don't.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\     Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html   ///
Reply | Threaded
Open this post in threaded view
|

Re: How to solve: E254: Cannot allocate color darkyellow

Alan Schmitt
Le 6 juin 05, à 12:22, Bram Moolenaar a écrit :

>
> Alan Schmitt wrote:
>
>> I've been having this problem for a while, and I would like to solve
>> it. Using some syntax hilighters, I keep getting the error: E254:
>> Cannot allocate color darkyellow
>>
>> I looked at the help for that error, but I could not find how to solve
>> it. Any suggestion? I'm using ViM 6.3 for OS X (gvim version). The
>> strange thing is that everything works when I use vim in the terminal,
>> and not gvim.
>
> The problem is that the GUI doesn't know the color DarkYellow, although
> it should (it's a standard color).
>
> If you have a ":colorscheme" command, avoid it, or if you see the
> DarkYellow color used somewhere replace it with "#BBBB00".
Thanks for the suggestion. I'm not using any colorscheme, and I tried
switching them but it changed nothing.

I'm copying the vim-mac mailing list in case someone has already seen
this.

Alan

PGP.sig (193 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to solve: E254: Cannot allocate color darkyellow

Eric Arnold


It's not clear if you tried:

        hi def darkyellow guifg=#BBBB00

"darkyellow" is not a default color for me (MSwinXP) also.  "darkyellow"
is defined as a keyword in "vim.vim" and many other files, but I couldn't
find the basic definition by doing a 'grep -Rin darkyellow .' in
my vim63 directory.  I'm wondering if it used to be a default color and
got lost somewhere in some release.

However I have no problem creating it.  If you simply want the color for
your own self, you can put it in the bottom of your .gvimrc as

        autocmd GUIEnter * hi def darkyellow guifg=#BBBB00

Having it as a autocmd might be overkill, but it was the only way I was
able to override the colors in my colorscheme in my .gvimrc or .vimrc
and have the change stick.

If   :echo g:colors_name  shows nothing or is undefined for you (meaning
"colorscheme" is really not in effect), and you want to make a darkyellow
that works for other users as well, it might be worth making your own
colorscheme file with darkyellow in it, but you'd have to change
everybody's .gvimrc   so use it, so it's hard to say if it is worth it for
just a color or two.

Another way to do it without changing anyone's   .*vimrc   files, and I
don't know if this is the correct way to do it or not, would be to put a
version of the    syncolor.vim    file (because it is one of the files called
in the default start up) in your $HOME/.vim/after/syntax
directory  ( or $HOME/vimfiles/after/syntax etc.) with the single line:

        hi def darkyellow guifg=#BBBB00

This works for me if I put it in my $HOME/vimfiles/after/syntax directory,
but it is supposed to also work in    $VIM/after/syntax   which should
define the color for other users also, but I can't get that to work.  I'm
just inferring what the directory should be from the help entry:

                                                        *after-directory*
        4. In the "after" directory in the system-wide Vim directory.  This is
           for the system administrator to overrule or add to the distributed
           defaults (rarely needed)
        5. In the "after" directory in your home directory.  This is for
           personal preferences to overrule or add to the distributed defaults
           or system-wide settings (rarely needed).


So, #5 works but #4 has me stumped.



--- Alan Schmitt <[hidden email]> wrote:

> Le 6 juin 05, ? 12:22, Bram Moolenaar a ?crit :
>
> >
> > Alan Schmitt wrote:
> >
> >> I've been having this problem for a while, and I would like to solve
> >> it. Using some syntax hilighters, I keep getting the error: E254:
> >> Cannot allocate color darkyellow
> >>
> >> I looked at the help for that error, but I could not find how to solve
> >> it. Any suggestion? I'm using ViM 6.3 for OS X (gvim version). The
> >> strange thing is that everything works when I use vim in the terminal,
> >> and not gvim.
> >
> > The problem is that the GUI doesn't know the color DarkYellow, although
> > it should (it's a standard color).
> >
> > If you have a ":colorscheme" command, avoid it, or if you see the
> > DarkYellow color used somewhere replace it with "#BBBB00".
>
> Thanks for the suggestion. I'm not using any colorscheme, and I tried
> switching them but it changed nothing.
>
> I'm copying the vim-mac mailing list in case someone has already seen
> this.
>
> Alan
>


Reply | Threaded
Open this post in threaded view
|

Re: How to solve: E254: Cannot allocate color darkyellow

A.J.Mechelynck
In reply to this post by Alan Schmitt
Alan Schmitt wrote:

> Hello,
>
> I've been having this problem for a while, and I would like to solve it.
> Using some syntax hilighters, I keep getting the error: E254: Cannot
> allocate color darkyellow
>
> I looked at the help for that error, but I could not find how to solve
> it. Any suggestion? I'm using ViM 6.3 for OS X (gvim version). The
> strange thing is that everything works when I use vim in the terminal,
> and not gvim.
>
> Alan

The colour console uses the "cterm= ctermfg= ctermbg= " properties of
":highlight" statements while the GUI uses the "gui= guifg= guibg= "
properties. The two are completely independent.

IIUC, after ctermfg= or ctermbg=, "darkyellow" is equivalent to "brown";
but after guifg= or guibg=, "darkyellow" is simply undefined.

Try to find the pattern /\c\<gui.g=darkyellow\>/ in your current
colorscheme; if that colorscheme is a "locally-written" file (in
$HOME/.vim/colors, $HOME/vimfiles/colors or $VIM/vimfiles/colors) you
can replace "darkyellow" by "brown" wherever it appears after guifg= or
guibg= (after ctermfg= or ctermbg= it is unnecessary but harmless).

If it is a "distributed" colorscheme (in $VIMRUNTIME/colors) you will
have to first copy it to $VIM/vimfiles/colors (then proceed as above)
and you will also have to notify the colorscheme's maintainer of the
error. (If you correct it in place in the $VIMRUNTIME tree, the next
upgrade might silently overwrite the good version with the bad.
$VIM/vimfiles is for system-wide full-fledged scripts.)


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: How to solve: E254: Cannot allocate color darkyellow

A.J.Mechelynck
In reply to this post by Eric Arnold
Eric Arnold wrote:
>
> It's not clear if you tried:
>
> hi def darkyellow guifg=#BBBB00
>
[...]

The way I understand it, the above would defined the _highlight group_
darkyellow with fg=#BBBB00 as its default colour. You cannot use that
where you would a _color name_, any more that you can use "guifg=Error"
or "guifg=NonText". You have to replace the offending "guifg=darkyellow"
or "guibg=darkyellow" clause. See my post of a few minutes ago.


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: How to solve: E254: Cannot allocate color darkyellow

Eric Arnold
In reply to this post by A.J.Mechelynck


--- "A. J. Mechelynck" <[hidden email]> wrote:

> Alan Schmitt wrote:
...
> $VIM/vimfiles is for system-wide full-fledged scripts.)

Well, this answers one of my questions.  I was trying to put stuff in
$VIM/after instead of $VIM/vimfiles/after.  The doc.s about "after" aren't
all that clear:
                *after-directory*
        4. In the "after" directory in the system-wide Vim directory.

The "system-wide" Vim directory is easily interpreted wrongly as $VIM.


Reply | Threaded
Open this post in threaded view
|

Re: How to solve: E254: Cannot allocate color darkyellow

A.J.Mechelynck
Eric Arnold wrote:

>
> --- "A. J. Mechelynck" <[hidden email]> wrote:
>
>
>>Alan Schmitt wrote:
>
> ...
>
>>$VIM/vimfiles is for system-wide full-fledged scripts.)
>
>
> Well, this answers one of my questions.  I was trying to put stuff in
> $VIM/after instead of $VIM/vimfiles/after.  The doc.s about "after" aren't
> all that clear:
> *after-directory*
> 4. In the "after" directory in the system-wide Vim directory.
>
> The "system-wide" Vim directory is easily interpreted wrongly as $VIM.
>
>
>
>
>

See also the 'runtimepath' option and the ":runtime" and ":runtime!"
commands. 'runtimepath' lists (as a comma-separated list) the roots of
several directory trees in which Vim will search (in sequence) for its
runtime files. Usually there are five directories listed, as follows:


$HOME/.vim or $HOME/vimfiles
user-specific full-fledged scripts

$VIM/vimfiles
system-wide full-fledged scripts

$VIMRUNTIME
full-fledged scripts that came with the distribution. Do not make
changes here! Any changes may be silently overwritten by a future upgrade.

$VIM/vimfiles/after
system-wide overrides to individual settings set by scripts of the same
name and tree position in any of the above

$HOME/.vim/after or $HOME/vimfiles/after
user-specific overrides to individual settings set by scripts of the
same name and tree position in any of the above


By default, only $VIMRUNTIME is created at install-time; it contains a
full set of subdirectories. Scripts of the same function should be at
the same position in the tree; if they are to be loaded together, they
should also have the same name. For instance, all colorschemes should be
in the colors/ subdirectory of directories named in 'runtimepath', all
keymaps in the keymap/ subdirectory, all filetype-plugins in the
ftplugin/ subdirectory, etc.


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: How to solve: E254: Cannot allocate color darkyellow

Eric Arnold
In reply to this post by A.J.Mechelynck

Note to Alan.  Your original message didn't say exactly how you were
trying to use "darkyellow".

>> I've been having this problem for a while, and I would like to solve
>> it. Using some syntax hilighters, I keep getting the error: E254:
>> Cannot allocate color darkyellow

As it turns out, it is a color, not a color group ("group" is misleading
IMHO), so you can only use it after "guifg=" or "guibg=", etc.  not for
commands like "match".  If you want that, you can define a color group of
the same name, as long as you don't let it confuse things more.   I.e.:

        match darkyellow /pattern/

fails, but

        hi darkyellow guifg=darkyellow
        match darkyellow /pattern/

works.

If it turns out that "darkyellow" really isn't defined as a core color
on your system, and it has somewhere been defined as a color group,
this results in the same error as for non-existent colors when trying
to use it as a color in "guifg=", etc.,

        E254 cannot allocate color [some color group name]

which is the error that matches the one you first posted about.


--- "A. J. Mechelynck" <[hidden email]> wrote:


> Eric Arnold wrote:
> >
> > It's not clear if you tried:
> >
> > hi def darkyellow guifg=#BBBB00
> >
> [...]
>
> The way I understand it, the above would defined the _highlight group_
> darkyellow with fg=#BBBB00 as its default colour. You cannot use that
> where you would a _color name_, any more that you can use "guifg=Error"
> or "guifg=NonText". You have to replace the offending "guifg=darkyellow"
> or "guibg=darkyellow" clause. See my post of a few minutes ago.


Hmm.  It actually worked, sorta, kinda.  I think this is because
"darkyellow" is defined more deeply in Vim, so although I [re]defined it as a
group, I didn't change it's ability to be used as a color in   guifg=   ,
which is what tripped me up when I tested it for my last message.  
Apparently, colors and color groups have different name spaces.

Also,   :hi def ..    or   :highlight default ...  isn't actually desirable
here, since we *do* want to override a default rather than set one.  As
explained by   :h hi-default  , the "def" simply seems to be a way to
control what overrides what.  So I guess I was wrong on multiple accounts.

The big mystery for me though, the difference between colors and color groups.
This is why "darkyellow" as delivered with vim63, is usable (for me) as a
color in   guifg=darkyellow    but not as a group for the "match" command,
until I [accidentally] defined a group of the same name.  Another test that
seems obvious that basic colors are different from groups,  

        :hi darkyellow
returns
        E411: highlight group not found

I'm still trying to understand how to define a color which is not a group.
Since "grep" didn't show me anything in the "syntax" or "colors"
directories, I'm assuming it's defined deeper in the Vim structure.  The
doc.s all seem to point to "syntax.txt", which tells us "highlight" is
the way to create colors, but only color groups.  Is there a help entry
on the difference?  (I found only the entries on what colors were available
for different GUI and terminal types, but not how to define your own.)
I'm suspecting that it isn't possible, or else there wouldn't be so many
#HEXHEXHEX  defines where color names would be more readable.



Reply | Threaded
Open this post in threaded view
|

Re: How to solve: E254: Cannot allocate color darkyellow

A.J.Mechelynck
Eric Arnold wrote:

> Note to Alan.  Your original message didn't say exactly how you were
> trying to use "darkyellow".
>
>
>>>I've been having this problem for a while, and I would like to solve
>>>it. Using some syntax hilighters, I keep getting the error: E254:
>>>Cannot allocate color darkyellow
>
>
> As it turns out, it is a color, not a color group ("group" is misleading
> IMHO), so you can only use it after "guifg=" or "guibg=", etc.  not for
> commands like "match".  If you want that, you can define a color group of
> the same name, as long as you don't let it confuse things more.   I.e.:
>
> match darkyellow /pattern/
>
> fails, but
>
> hi darkyellow guifg=darkyellow
> match darkyellow /pattern/
>
> works.

Oy yeah? I would expect the same error on the "hi" line as that noticed
by the OP (i.e., E254)

> [...] The big mystery for me though, the difference between colors and color groups.
> This is why "darkyellow" as delivered with vim63, is usable (for me) as a
> color in   guifg=darkyellow    but not as a group for the "match" command,
> until I [accidentally] defined a group of the same name.  Another test that
> seems obvious that basic colors are different from groups,  
>
> :hi darkyellow
> returns
> E411: highlight group not found
>
> I'm still trying to understand how to define a color which is not a group.
> Since "grep" didn't show me anything in the "syntax" or "colors"
> directories, I'm assuming it's defined deeper in the Vim structure.  The
> doc.s all seem to point to "syntax.txt", which tells us "highlight" is
> the way to create colors, but only color groups.  Is there a help entry
> on the difference?  (I found only the entries on what colors were available
> for different GUI and terminal types, but not how to define your own.)
> I'm suspecting that it isn't possible, or else there wouldn't be so many
> #HEXHEXHEX  defines where color names would be more readable.


Highlight "group" names are defined either by Vim itself (see the
'highlight' option) or by syntax scripts (as syntax groups). There is a
limit (a high one) on the maximum number of different highlight groups
which can be defined in a running instance of Vim; I don't know what it is.


Color names can be either symbolic (see below) or numeric (in the form
#RRGGBB, in hex).

Color values in the form #RRGGBB can be used anywhere in guifg= or guibg=

Symbolic color names can also be used, provided that they are defined on
your system, see ":help rgb.txt". $VIMRUNTIME/rgb.txt defines the
default set. The help text says that "it must be located in
$VIMRUNTIME", which implicitly means that you cannot change it. I don't
know if (or why not) it can reside also in any other directory in
'runtimepath' or whether additions to it may or may not be done by means
of a file named, let's say, $VIM/vimfiles/after/rgb.txt


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: How to solve: E254: Cannot allocate color darkyellow

Eric Arnold
--- "A. J. Mechelynck" <[hidden email]> wrote:
> Eric Arnold wrote:
...

> >
> > As it turns out, it is a color, not a color group ("group" is misleading
> > IMHO), so you can only use it after "guifg=" or "guibg=", etc.  not for
> > commands like "match".  If you want that, you can define a color group of
> > the same name, as long as you don't let it confuse things more.   I.e.:
> >
> > match darkyellow /pattern/
> >
> > fails, but
> >
> > hi darkyellow guifg=darkyellow
> > match darkyellow /pattern/
> >
> > works.
>
> Oy yeah? I would expect the same error on the "hi" line as that noticed
> by the OP (i.e., E254)

I was a little surprised when it worked, but since it appears that the name
spaces are independent, there's nothing to keep you from doing it.  It
still might not work for the original poster, if "darkyellow" isn't defined
as a color ("darkyellow" isn't in "rgb.txt", but there are 6 different
light yellows.  Hmm, how many light yellows does it take to make a dark
yellow? ).

>
...
> Symbolic color names can also be used, provided that they are defined on
> your system, see ":help rgb.txt". $VIMRUNTIME/rgb.txt defines the
> default set. The help text says that "it must be located in
> $VIMRUNTIME", which implicitly means that you cannot change it. I don't
> know if (or why not) it can reside also in any other directory in
> 'runtimepath' or whether additions to it may or may not be done by means
> of a file named, let's say, $VIM/vimfiles/after/rgb.txt

The good news is that "rgb.txt" is monitored at run time, so it picks
up changes to "rgb.txt" as soon as you make them (without restarting
Vim).  The bad  news that adding another "rgb.txt" to $VIM/vimfiles or
$VIM/vimfiles/after doesn't seem to work.

Anyway, adding the equivalent of #BBBB00,
    187 187 0 darkyellow
to "rgb.txt" is another thing for Alan to try, after
    hi test guifg=darkyellow
to be sure you get the E254 not found error.

Reply | Threaded
Open this post in threaded view
|

Re: How to solve: E254: Cannot allocate color darkyellow

A.J.Mechelynck
Eric Arnold wrote:
[...]
> Anyway, adding the equivalent of #BBBB00,
>     187 187 0 darkyellow
> to "rgb.txt" is another thing for Alan to try, after
>     hi test guifg=darkyellow
> to be sure you get the E254 not found error.
>
>
>
>

My rgb.txt doesn't include "darkyellow", nor is that name listed in a
list of symbolic color name which I found in an appendix to a book over
HTML. It lists the colors in lexicographic order on the RRGGBB value.
I'm not listing the whole long list, but here are the names for colors
whose red component is in the range B0-BF:

#B0C4DE Lightsteelblue
#B0E0E6 Powderblue
#B22222 Firebrick
#B8860B Darkgoldenrod
#BA55D3 Mediumorchid
#BC8F8F Rosybrown
#BDB76B Darkkhaki

IIUC, "darkyellow" is not a standard symbolic colour name. For
portability, I would suggest to replace it (after guifg= or guibg=)
either by a numeric value such as #BBBB00, or by a "standard" symbolic
name; here are a few examples:

#A52A2A Brown
#808000 Olive (not in my rgb.txt)
#FFFF00 Yellow


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

[SOLVED] Re: How to solve: E254: Cannot allocate color darkyellow

Alan Schmitt
In reply to this post by Eric Arnold
Le 7 juin 05, à 06:39, Eric Arnold a écrit :

> --- "A. J. Mechelynck" <[hidden email]> wrote:
>
>> Symbolic color names can also be used, provided that they are defined
>> on
>> your system, see ":help rgb.txt". $VIMRUNTIME/rgb.txt defines the
>> default set. The help text says that "it must be located in
>> $VIMRUNTIME", which implicitly means that you cannot change it. I
>> don't
>> know if (or why not) it can reside also in any other directory in
>> 'runtimepath' or whether additions to it may or may not be done by
>> means
>> of a file named, let's say, $VIM/vimfiles/after/rgb.txt
>
> The good news is that "rgb.txt" is monitored at run time, so it picks
> up changes to "rgb.txt" as soon as you make them (without restarting
> Vim).  The bad  news that adding another "rgb.txt" to $VIM/vimfiles or
> $VIM/vimfiles/after doesn't seem to work.
>
> Anyway, adding the equivalent of #BBBB00,
>     187 187 0 darkyellow
> to "rgb.txt" is another thing for Alan to try, after
>     hi test guifg=darkyellow
> to be sure you get the E254 not found error.
First of all, thanks a lot to Eric and Antoine for this enlightening
discussion. Some of it went way over my head, but I was able to solve
the problem.

As I'm using the default colorscheme, I did not really know what to do
(and where to copy it from). I also had no g:colors_name defined.

So I edited $VIMRUNTIME/rgb.txt and added the line suggested above, and
everything is working now. It bothers me a little to have to edit vim
runtime files directly, but I'll know what to do next time I upgrade my
Vim.

Thanks again to everyone,

Alan

PGP.sig (193 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to solve: E254: Cannot allocate color darkyellow

Alan Schmitt
In reply to this post by A.J.Mechelynck
Le 7 juin 05, à 07:16, A. J. Mechelynck a écrit :

> IIUC, "darkyellow" is not a standard symbolic colour name. For
> portability, I would suggest to replace it (after guifg= or guibg=)
> either by a numeric value such as #BBBB00, or by a "standard" symbolic
> name; here are a few examples:
>
> #A52A2A Brown
> #808000 Olive (not in my rgb.txt)
> #FFFF00 Yellow

The problem is that I do not know where this "darkyellow" comes from. I
have the error when I edit otl files (vimoutliner files) and ml files
using the omlet filetype. I guess these syntax hilighters are using
this colour.

Alan

PGP.sig (193 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [SOLVED] Re: How to solve: E254: Cannot allocate color darkyellow

A.J.Mechelynck
In reply to this post by Alan Schmitt
Alan Schmitt wrote:
[...]

> First of all, thanks a lot to Eric and Antoine for this enlightening
> discussion. Some of it went way over my head, but I was able to solve
> the problem.
>
> As I'm using the default colorscheme, I did not really know what to do
> (and where to copy it from). I also had no g:colors_name defined.
>
> So I edited $VIMRUNTIME/rgb.txt and added the line suggested above, and
> everything is working now. It bothers me a little to have to edit vim
> runtime files directly, but I'll know what to do next time I upgrade my
> Vim.
>
> Thanks again to everyone,
>
> Alan

If you have no colorscheme defined, you must have one or more
":hi[ghlight]" statements somewhere, probably in your vimrc but maybe
elsewhere. If it bothers you (as it bothers me) to edit distribution
files, you may want to search your vimrc (and any scripts sourced from
it) for the pattern /\c\<darkyellow\>/ . You might even try

        :1,$s/\c\(gui.g=\)darkyellow\>/\1#BBBB00/g

Add a c at the very end if you want to "confirm" every substitution.


Or else (a trick mentioned at ":help fvwm.vim", I *don't* know if it
works for non-Unix systems) you might move your rgb.txt elsewhere, let's
say in your home directory, and add

        let rgb_file = $HOME . "/rgb.txt"

to your _vimrc.


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: How to solve: E254: Cannot allocate color darkyellow

A.J.Mechelynck
In reply to this post by Alan Schmitt
Alan Schmitt wrote:

> Le 7 juin 05, ? 07:16, A. J. Mechelynck a ?crit :
>
>> IIUC, "darkyellow" is not a standard symbolic colour name. For
>> portability, I would suggest to replace it (after guifg= or guibg=)
>> either by a numeric value such as #BBBB00, or by a "standard" symbolic
>> name; here are a few examples:
>>
>> #A52A2A Brown
>> #808000 Olive (not in my rgb.txt)
>> #FFFF00 Yellow
>
>
> The problem is that I do not know where this "darkyellow" comes from. I
> have the error when I edit otl files (vimoutliner files) and ml files
> using the omlet filetype. I guess these syntax hilighters are using this
> colour.
>
> Alan

Well, it must come from some script that you sourced. All those scripts'
names are listed by the ":scriptnames" command. You may want to search
scripts in that list for /darkyellow/


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: How to solve: E254: Cannot allocate color darkyellow

Alan Schmitt
Le 7 juin 05, à 09:31, A. J. Mechelynck a écrit :

> Alan Schmitt wrote:
>> Le 7 juin 05, à 07:16, A. J. Mechelynck a écrit :
>>
>>> IIUC, "darkyellow" is not a standard symbolic colour name. For
>>> portability, I would suggest to replace it (after guifg= or guibg=)
>>> either by a numeric value such as #BBBB00, or by a "standard"
>>> symbolic
>>> name; here are a few examples:
>>>
>>> #A52A2A Brown
>>> #808000 Olive (not in my rgb.txt)
>>> #FFFF00 Yellow
>>
>>
>> The problem is that I do not know where this "darkyellow" comes from.
>> I
>> have the error when I edit otl files (vimoutliner files) and ml files
>> using the omlet filetype. I guess these syntax hilighters are using
>> this
>> colour.
>>
>> Alan
>
> Well, it must come from some script that you sourced. All those
> scripts'
> names are listed by the ":scriptnames" command. You may want to search
> scripts in that list for /darkyellow/
Thanks for the suggestion. The culprit was syntax/vo_base.vim. I'm
putting the vimoutliner mailing list in copy, as this script comes from
there.

Executive summary: darkyellow does not exist and is not defined on some
systems, so it should not be used as a color.

Thanks again,

Alan

PGP.sig (193 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to solve: E254: Cannot allocate color darkyellow

Eric Arnold

> Alan Schmitt wrote:
[...]
> > The problem is that I do not know where this "darkyellow" comes from. I
> > have the error when I edit otl files (vimoutliner files) and ml files
> > using the omlet filetype. I guess these syntax hilighters are using this
> > colour.

Well, there's two questions about "where" it(the Problem Color) comes from,
i.e. two conceptual directions, from inside or outside of the Vim core:

  1) The "darkyellow" that is supposed to be defined by Vim.

     "darkyellow" seems to be defined with a default set of other colors
     for varying GUI types.  There doesn't seem to be any runtime files
     where it is defined.

  2) The "darkyellow" that is used in your scripts that are causing your
     errors:  "otl" and "omlet" filetypes( ftplugin/ ), syntax/ ,
     and/or other supporting files.  [(newsflash:) syntax/vo_base.vim ]

--- "A. J. Mechelynck" <[hidden email]> wrote:
> Well, it must come from some script that you sourced. All those scripts'
> names are listed by the ":scriptnames" command. You may want to search
> scripts in that list for /darkyellow/

> Alan Schmitt wrote:
>
> Thanks for the suggestion. The culprit was syntax/vo_base.vim. I'm
> putting the vimoutliner mailing list in copy, as this script comes from
> there.
>
> Executive summary: darkyellow does not exist and is not defined on some
> systems, so it should not be used as a color.


If it is a single file, this is a good solution.  It does make one
wonder if this is a problem that might crop up again.  It comes down to
a question of what is more maintainable.  Changing the "rgb.txt", which
is part of the Vim distribution, or changing one or more scripts in
various places.  (Changing them to use #BBBB00, or another color,
instead of "darkyellow".) If the number of files you have to change
isn't too large, and they won't be a problem with further releases, then
that might be better, else I'd say it would be better to make a single
annoying change("rgb.txt") that fixes all the other current
and future problems.  Of course, you could do some of both, as it
seems you have done already.

It is odd that "darkyellow" managed to get into the Vim color set
without being in any standard.  It begs the question of what other colors
are in this catagory, and whether it's a problem worth fixing at the
source:
 
  1) by clearly defining what colors Vim will be supporting as a
     basic set across all platforms ( I couldn't find a definitive
     list in the doc.s, though several misc sets were discussed ).

and/or

  2) by adhering to whatever the standard might be (and make that list
     clear in the doc.s also).


P.S.  It wasn't clear to me whether   rgb_file   was supposed to be
useful for Vim use, or for fvwm specific use.  In any case, I can't get
it to work for this problem on WinXP.

    let rgb_file = "/usr/X11/lib/X11/rgb.txt"


Reply | Threaded
Open this post in threaded view
|

Re: How to solve: E254: Cannot allocate color darkyellow

A.J.Mechelynck
Eric Arnold wrote:
[...]
> P.S.  It wasn't clear to me whether   rgb_file   was supposed to be
> useful for Vim use, or for fvwm specific use.  In any case, I can't get
> it to work for this problem on WinXP.
>
>     let rgb_file = "/usr/X11/lib/X11/rgb.txt"

"/usr/X11/lib/X11/rgb.txt" is a typical Unix path. On Windows, paths are
different. If you have a "home-brewed" rgb.txt in your home directory,
you might want to try something like (untested)

        :let rgb_file = "~/rgb.txt"

or

        :let rgb_file = "C:\DOCUME~1\arnold\rgb.txt"

IOW, wherever the rgb.txt that you want to use, you have to tell Vim
exactly where it is to be found (if you don't, $VIMRUNTIME/rgb.txt will
be used by default). A nonexistent path is of course of no help. And
it's still not clear to me whether rgb_file is usable on all Vim
versions, or just on Unix versions (which can interface with the fvwm
window manager). I suspect the former, but only experiment will prove me
right or wrong.


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: How to solve: E254: Cannot allocate color darkyellow

Eric Arnold

...Power hit, ignore if duplicate.

--- "A. J. Mechelynck" <[hidden email]> wrote:

> Eric Arnold wrote:
> [...]
> > P.S.  It wasn't clear to me whether   rgb_file   was supposed to be
> > useful for Vim use, or for fvwm specific use.  In any case, I can't get
> > it to work for this problem on WinXP.
> >
> >     let rgb_file = "/usr/X11/lib/X11/rgb.txt"
> >
> "/usr/X11/lib/X11/rgb.txt" is a typical Unix path. On Windows, paths are
> different. If you have a "home-brewed" rgb.txt in your home directory,
> you might want to try something like (untested)


No, I didn't use this literally.  I just [hastily] included it as a
reminder of the doc.s and your prior message about "rgb.txt".  I did try
".", "~", moving to "~" and using ".", etc.  (I used "." since I'm using
Cyqwin, and it's always a challenge to know what Vim+Cygwin have
conjured up as a directory structure.)  Nothing added colors from my
new "rgb.txt".


>
> :let rgb_file = "~/rgb.txt"
>
> or
>
> :let rgb_file = "C:\DOCUME~1\arnold\rgb.txt"
>
> IOW, wherever the rgb.txt that you want to use, you have to tell Vim
> exactly where it is to be found (if you don't, $VIMRUNTIME/rgb.txt will
> be used by default). A nonexistent path is of course of no help. And
> it's still not clear to me whether rgb_file is usable on all Vim
> versions, or just on Unix versions (which can interface with the fvwm
> window manager). I suspect the former, but only experiment will prove me
> right or wrong.
>


I'm suspecting more that   rgb_file   is used by the "fvwm"
functionality, and not by the Vim GUI core itself.  So it would be nice
to know if it worked for a Unix user, but it might "work" (probably
dependent on whether "fvwm" is running), and yet Vim still might not
take color definitions from it for general use.

It would be cool if Vim used "runtimepath" for "rgb.txt" as with
other things.  Maybe someday...



12