proper way to add a new color scheme

Hi everyone,

I was in need for a color scheme that is very similar to "Percentage Identity".
But it should only paint the backgrounds of bases different than consensus with the color pink.
It is very simple in the sense that it doesn't require threshold values.

I couldn't find a way to do this from menus including "User defined" color scheme menu.
So i simply had to change PIDColorScheme.findColor method like this:

public Color findColour(char c, int j)
{
       if ('a' <= c && c <= 'z')
    {
      c -= ('a' - 'A');
    }

    if (consensus == null || j >= consensus.length || consensus[j] == null)
    {
      return Color.white;
    }

    Color currentColour = Color.white;

    if (consensus.length <= j)
    {
      return Color.white;
    }

    if (consensus[j].contains(String.valueOf(c)))
    {
        currentColour = Color.WHITE;
    } else
    {
        currentColour = Color.PINK;
    }
       return currentColour;
}

I will be glad if you point a better way to do this. How can i create this color scheme just by using the menus
not by ruining the source code.

Huseyin Kaya

Dear Huseyin.

···

On 09/12/2009 08:04, Huseyin Kaya wrote:

Hi everyone,

I was in need for a color scheme that is very similar to "Percentage
Identity".
But it should only paint the backgrounds of bases different than
consensus with the color pink.
It is very simple in the sense that it doesn't require threshold values.

I couldn't find a way to do this from menus including "User defined"
color scheme menu.
   

Jalview doesn't allow you to modify the consensus colourscheme at the moment. However, we have had a few requests regarding more configuration options for these colourschemes - I'll add your name to the list of testers, if you'd like!.

Jim.