A ball game of the middle ages called La Soule was played where players would drive a ball by their foot, hand or a stick of various kinds. The ball was usually made of leather and stuffed with hemp or wool. In some areas where the game was played custom dictated that the ball be decorated in a certain manner. In souther france the ball would be decorated into 4 sections with different colors with crosses painted on. In other regions the ball would be made in solid colors. This is one of the earliest examples of a ball game where the game ball was decorated to be visually notable for play.
Prior to the creation of Snooker around 1875 there were 2 other notable games for a form of billiard play. Those games were Pyramids and Life Pool. In the game of Pyramids a variation of the game required a set of 16 game balls. In the game of Life Pool, upto 12 people could play the game. Those 12 people would thus be referred to as a "Pool" of players basically. In order for those players to distinguish their own ball from the other players the game balls were brightly colored.
The game balls in Life Pool were colored as follows:
White, Red, Yellow, Green, Blue, Pink, Spot White, Spot Red, Spot Yellow, Spot Green, Spot Brown, Spot Blue, Spot Pink. There was a variation of Life Pool called Black Pool which included a Black ball.
Eventually the games of Pyramids and Life Pool were merged to form the game of Snooker. During the time of these games, game balls were crafted from Ivory. And the use of Ivory would continue to be used til the early part of the 20th century. But efforts at finding an Ivory subsititute began in the late 1860's with John Wesley Hyatt who began experimenting with other materials and is basically responsible for the discovery of plastic. Many experiments in material development from Mr. Hyatt and other inventors would see the creation of different types of ball materials over the decades til the creation modern phenolic materials which are now in use in modern ball sets.
However, while there is no serious discussion of ball markings when reviewing the history of ball development for the game of billiards, I myself can only infer that upto a certain period of time of the 19th century ball markings were a continuation of some forms of other traditional ball games and with the general purpose of allowing multiple players the ability to compete with one another by seperating their own balls from other competitors. That tradition seems to have merged into the eventual development of balls used for table games. The colors used in Life Pool seem to form the basis of tradition by which modern pool ball colors are derived from.
The numbering of balls it would seem to be from the early development of Snooker as a game and continued with the creation of the game of Fifteen Ball Pool which in led to the creation of Continous Pool, and then creation of 14.1 Straight Pool.
The above is what I can remember from my various readings from my own copy of the Billiard Encyclopedia 2nd edition.