256 Colors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm trying to add 256 colors to speakup.

What I've managed to do so far is

1. Add  256 colors to /sys/accessibility/speakup/i18n/colors

2. Use i18n colors for colors 9 through 15 instead of prepending "bright" before colors 1 through 7

3. Change 8 to 256 in a bunch of the loops in various places in main.c

Besides colors 0 through 15 working correctly, all the colors above that are spoken with the corresponding value of the colors 8 through 15. I.E. blue hues would be "bright blue" and green hues are "bright green"

I think the below function is what needs to be changed. (Note, I'm still using 3.1.6, as I'm still on an old kernel).

Does anyone who actually knows C and speakup tell me what I need to do to use the i18n color values for colors 16 through 255?



static void update_color_buffer(struct vc_data *vc, const char *ic, int len)
{
        int i, bi, hi;
        int vc_num = vc->vc_num;

        bi = ((vc->vc_attr & 0x70) >> 4);
        hi = speakup_console[vc_num]->ht.highsize[bi];

        i = 0;
        if (speakup_console[vc_num]->ht.highsize[bi] == 0) {
                speakup_console[vc_num]->ht.rpos[bi] = vc->vc_pos;
                speakup_console[vc_num]->ht.rx[bi] = vc->vc_x;
                speakup_console[vc_num]->ht.ry[bi] = vc->vc_y;
        }
        while ((hi < COLOR_BUFFER_SIZE) && (i < len)) {
                if ((ic[i] > 32) && (ic[i] < 127)) {
speakup_console[vc_num]->ht.highbuf[bi][hi] = ic[i];
                        hi++;
                } else if ((ic[i] == 32) && (hi != 0)) {
if (speakup_console[vc_num]->ht.highbuf[bi][hi - 1] !=
                            32) {

speakup_console[vc_num]->ht.highbuf[bi][hi] =
                                    ic[i];
                                hi++;
                        }
                }
                i++;
        }
        speakup_console[vc_num]->ht.highsize[bi] = hi;
}


Thanks!

Trevor





[Index of Archives]     [Linux for the Blind]     [Fedora Discussioin]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]

  Powered by Linux