Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisCodesThings committed Mar 10, 2024
1 parent 3886f50 commit 961ba9e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 27 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# stub-repo · [![Test workflow status](https://github.com/ChrisCodesThings/stub-repo/actions/workflows/test.yml/badge.svg)](../../actions/workflows/test.yml) [![NPM Version](https://img.shields.io/npm/v/@chriscodesthings/stub-repo)](https://www.npmjs.com/package/@chriscodesthings/stub-repo) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
# rgb-color-yiq-value · [![Test workflow status](https://github.com/ChrisCodesThings/rgb-color-yiq-value/actions/workflows/test.yml/badge.svg)](../../actions/workflows/test.yml) [![NPM Version](https://img.shields.io/npm/v/@chriscodesthings/rgb-color-yiq-value)](https://www.npmjs.com/package/@chriscodesthings/rgb-color-yiq-value) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

> **Function to determine if something is a string type**
> **Calculate the YIQ value of a color in RGB format**
## Install

```sh
npm install --save @chriscodesthings/stub-repo
npm install --save @chriscodesthings/rgb-color-yiq-value
```

## Use

```js
import stubRepo from '@chriscodesthings/stub-repo';
import isString from '@chriscodesthings/rgb-color-yiq-value';

console.log(stubRepo("hello world!"));
// => true
console.log(rgbYIQValue(102,153,255));
// => 149.379
```

## Syntax

```js
stubRepo(var);
rgbYIQValue(r, g, b);
```

### Parameters

- *var*: any
- *r, g, b*: red green and blue color components

### Return Value

Returns something probably.
Returns calculated YIQ value of the color.

## Description

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default } from "./src/stubRepo.js";
export { default } from "./src/rgbColorYIQValue.js";

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@chriscodesthings/stub-repo",
"name": "@chriscodesthings/rgb-color-yiq-value",
"version": "0.1.0",
"description": "npm package template",
"description": "Calculate the YIQ value of a color in RGB format",
"keywords": [
"stub",
"package",
"template"
"rgb",
"color",
"yiq"
],
"repository": {
"type": "git",
"url": "git+https://github.com/ChrisCodesThings/stub-repo.git"
"url": "git+https://github.com/ChrisCodesThings/rgb-color-yiq-value.git"
},
"main": "index.js",
"type": "module",
Expand All @@ -23,7 +23,7 @@
"node": ">=18.0.0"
},
"bugs": {
"url": "https://github.com/ChrisCodesThings/stub-repo/issues"
"url": "https://github.com/ChrisCodesThings/rgb-color-yiq-value/issues"
},
"scripts": {
"test": "NODE_OPTIONS='--experimental-vm-modules' jest",
Expand Down
4 changes: 4 additions & 0 deletions src/rgbColorYIQValue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

export default function (r, g, b) {
return ((r * 299) + (g * 587) + (b * 114)) / 1000;
}
5 changes: 0 additions & 5 deletions src/stubRepo.js

This file was deleted.

7 changes: 4 additions & 3 deletions tests/index.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

const { default: testFunc } = await import("../");

describe("testing my module", () => {
test("expect function to return true", async () => {
expect(testFunc()).toEqual(true);
describe("let's check the value of cornflowerblue", () => {
test("checking YIQ value", async () => {
expect(testFunc(102, 153, 255)).toEqual(149.379);
});
});

0 comments on commit 961ba9e

Please sign in to comment.