Contents

insertColor(_:key:at:)

Inserts the specified color at the specified location in the color list.

Declaration

func insertColor(_ color: NSColor, key: NSColor.Name, at loc: Int)

Parameters

  • color:

    The color to add to the color list.

  • key:

    The key with which to associate the color.

  • loc:

    The location in the color list at which to place the specified color. Locations are numbered starting with 0.

Discussion

If the list already contains a color with the same key at a different location, it’s removed from the old location. This method posts didChangeNotification to the default notification center. It raises NSColorListNotEditableException if the color list isn’t editable.

See Also

Managing Colors By Key