Pernambuco had its flag even before the independence of Brazil. It represented the Pernambucan Revolution of 1817, which, before the times of the Empire, proclaimed in the country the republican form of government. The flag was forgotten for a long time until 1917.
In 1817 a republican revolution attempted to put an end to the monarchy. The revolutionaries used a flag with the blue and white colors (the traditional Portuguese colors) with the blue symbolizing the sky and the white the land. The cross was for religion, the rainbow signaled the beginning of a new period, the upper star symbolized the state, and the sun lighted the future. In 1917, Manoel Antônio Pererira Borda, president of the state, converted it into the official flag of the state.
The state website says, "The blue color in the upper rectangle symbolizes the grandeur of the Pernambuco sky. The color the white area is for peace. The three-colored rainbow represents the union of all the people of Pernambuco. The star indicates the state within the grouping of the Federation. The sun is the force and energy of Pernambuco, and finally, the cross represents our faith in justice and mutual understanding." Contrary to many depictions, the rainbow is consistently described by the state government as being of three colors (red-yellow-green), not as the natural seven-color spectrum.
On p. 153 of Brazões e bandeiras do Brasil, Clóvis Ribeiro quotes decree 459 of 23 February 1917, which adopted this flag as that of the state:
Art. 1. The flag of the revolution of 1817 is declared to be the flag of the State of Pernambuco.
Art. 2. This flag is bicolor, dark blue and white, being divided into two unequal sections, the upper larger one being blue, having a rainbow with a star above it and a sun below inside the semicircle; the lower white with a red cross; the sun and star are gold.At the website of an Espírito Santo newspaper is the preambular language from this decree, confirming that the flag's adoption as the state flag was explicitly in the context of the 100th anniversary of the revolution. Ribeiro's 1933 plate of this flag shows it with a face on the sun, which does not appear on the modern flag, and straight rays rather than the wavy ones on the modern flag. Also note that all legal descriptions refer to the flag as dark blue and white, not the light blue shown in many flag books. And finally, for the record, this from the current constitution of the state, Art. 3, Sec. 1: "The flag of the state is that conceived by the martyrs of the Republican Revolution of 1817, hoisted for the first time on 2 April 1817."