Patent ID: 6897877

Claim:
A method in a data processing system for managing color maps, the method comprising: responsive to a request to add a color map to a color table, determining whether the color map is already installed in the color table; if the color map is not already installed in the color table, deciding whether a contiguous free block of color table entries sufficient to hold the color map is present in the color table; determining whether existing blocks of color table entries in the color table can be rearranged to form a new contiguous free block of color table entries, if the contiguous free block of color table entries is insufficient to hold the color map; rearranging the existing blocks of color table entries in the color table if the existing blocks of color table entries can be rearranged to form the new contiguous free block of color table entries; and installing the color map in the new contiguous free block of color table entries after the new contiguous free block of color table entries has been formed by rearranging the existing blocks of color table entries.