ColorPalette.Colors (gb.form)

Property Colors As Integer[]

Return or set the list of all colors in the palette.

Note: In order to modify the list you must write the whole array and not single Colors[] item.

For example these lines will not work...
 ColorPallete1.Colors[1] = Color.Red
 ColorPallete1.Colors.Remove(2, 1)
Using the ColorPallete1.Colors[] items like that calls the Colors_Read() method that returns only a copy of the list so modifications will not take effect.


You must use something like this...
  Dim aColorList As Integer[] = ColorPallete1.Colors
  aColorList[1] = Color.Red
  aColorList.Remove(2, 1)

  ColorPallete1.Colors = aColorList
Using ColorPallete1.Colors = aColorList like that calls the Colors_Write() method that WILL update the ColorPallet.