Get realistic colors of stars in rgb or hex. Datas come from Mitchell Charity's.
npm install --save star-colors
const starColors = require('star-colors');
const O5V = starColors.get('O5V');
// O5V
// {
// "class": "O5V",
// "r": "155",
// "g": "176",
// "b": "255",
// "hex": "#9bb0ff"
// }
Or in Html:
<script src="/path/to/star-colors.min.js"></script>
Return the entire data object of a specific stellar class. Including the following properities: class
, r
, g
, b
, hex
.
Return a random color in rgb code from data.
Return a random color in hex code from data.