It is not possible to create unique codes by random means, but there are 1.7 million different possibilities, so the changes of duplicates are slight.
You are not using random codes, but there is a bias; by using 15 you may never have an F in your codes. Read what Math.random() returns.
You should not use round if you are casting to an
int; it is completely unnecessary.
You might do well to insert your codes into a
Set, and keep going until the Set contains 300 elements.
Those two colours
are different. The difference is slight, but I can see it clearly.
This is a11c10 and this is aa020a. See, quite different.
As you have already been told, you will have to work out what you mean by dark colours.