I am not sure about the rounding (which is diffrent for each) of the corners to create a button. If one looks at a W95 square (not rounded) button you see that the basics is to make the under and right-side edges dark and the upper and left side bright. When corners are rounded, transition in those corners caught between the bright and dark edge is needed, in addition to the transition of each corner that makes it be rounded... I am thinking of creating images that can be saved and reused: the 4 corners, a tile-image for the space between upper & down right corners, another tile image for space between upper & down left corners, and a tile between left upper corner and right upper corner and a tile between left down corner and right down corner.. and then a tile in the inside space. The tiling is to create buttons of different size but with the same corners. No unique transitions depending on button size should be done; it's all in the pre-made images that make up the buttons parts.
Your first code created a good right-down corner, that in smaller size could be saved and used as that part in buttons. The image-system would enable one to manually create the pieces in an editor or create them with another algo should one want too...
The new code is more complicated without beeing of much use to me I think, but the first one is really on the right track. Could you make code for the other corners (thinking of how buttons are basically construced)?
Your first code created a good right-down corner, that in smaller size could be saved and used as that part in buttons. The image-system would enable one to manually create the pieces in an editor or create them with another algo should one want too...
The new code is more complicated without beeing of much use to me I think, but the first one is really on the right track. Could you make code for the other corners (thinking of how buttons are basically construced)?