# star-colors

> Get realistic colors of stars

Latest version **1.0.0** (published 2019-11-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install star-colors
pnpm add star-colors
yarn add star-colors
bun add star-colors
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-11-17 |
| First published | 2018-05-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 41 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | zoron |
| Maintainers | zoron |
| Keywords | astronomy, chromaticity, colors |

## Links

- npm: https://www.npmjs.com/package/star-colors
- Repository: https://github.com/fralonra/star-colors
- Homepage: https://github.com/fralonra/star-colors#readme
- Issues: https://github.com/fralonra/star-colors/issues
- npm.io page: https://npm.io/package/star-colors

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-11-17
- 0.0.1 — 2018-05-07

## README

# star-colors

[![Build Status](https://travis-ci.com/fralonra/star-colors.svg?branch=master)](https://travis-ci.com/fralonra/star-colors)
[![npm version](https://img.shields.io/npm/v/star-colors.svg)](https://www.npmjs.com/package/star-colors)

Get realistic colors of stars in rgb or hex. Datas come from [Mitchell Charity's](http://www.vendian.org/mncharity/dir3/starcolor/UnstableURLs/starcolors.txt).

## Install

```bash
npm install --save star-colors
```

## Usage

```javascript
const starColors = require('star-colors');

const O5V = starColors.get('O5V')；
// O5V
// {
//   "class": "O5V",
//   "r": "155",
//   "g": "176",
//   "b": "255",
//   "hex": "#9bb0ff"
// }
```

Or in **Html**:
```html
<script src="/path/to/star-colors.min.js"></script>
```

## API

### get (type)
Return the entire data object of a specific [stellar class](https://en.wikipedia.org/wiki/Stellar_classification#Spectral_types). Including the following properities: `class`, `r`, `g`, `b`, `hex`.

### randomRgb ()
Return a random color in rgb code from data.

### randomHex ()
Return a random color in hex code from data.

---
_Source: https://npm.io/package/star-colors · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
