Skip to content

Commit

Permalink
Merge pull request #39 from kmvan/dev
Browse files Browse the repository at this point in the history
fix progress bar rgb color error
  • Loading branch information
kmvan authored Sep 3, 2019
2 parents 1d88a60 + 9362d58 commit 19a8266
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 10 deletions.
2 changes: 1 addition & 1 deletion AppConfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"APP_VERSION": "3.1",
"APP_VERSION": "3.2",
"APP_NAME": "X Prober",
"APP_URL": "https://github.com/kmvan/x-prober",
"AUTHOR_URL": "https://inn-studio.com/prober",
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All Notable changes to `X-Prober` will be documented in this file

## 3.2 - 2019-08-03

### Fix

- Fix progress bar color error in old browser

## 3.1 - 2019-08-01

### Optimize
Expand Down
4 changes: 2 additions & 2 deletions dist/prober.php

Large diffs are not rendered by default.

70 changes: 70 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"object-assign": "^4.1.1",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-hot-loader": "^4.12.12",
"ts-loader": "^6.0.4",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Config/ConfigApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class ConfigApi
{
public static $APP_VERSION = '3.1';
public static $APP_VERSION = '3.2';
public static $APP_NAME = 'X Prober';
public static $APP_URL = 'https://github.com/kmvan/x-prober';
public static $APP_CONFIG_URL = 'https://raw.githubusercontent.com/kmvan/x-prober/master/AppConfig.json';
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Config/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import hexToRgb from '~components/Helper/src/components/hexToRgb'
import hexToRgb from '~components/Helper/src/components/hex-to-rgb'

export const BORDER_RADIUS = '2rem'
export const COLOR_DARK = '#333333'
Expand Down
6 changes: 3 additions & 3 deletions src/Components/Helper/src/components/gradient.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import rgbToHex from './rgbToHex'
import hexToRgb from './hexToRgb'
import rgbaToHex from './rgba-to-hex'
import hexToRgb from './hex-to-rgb'

const gradientColors = (
startColor: string,
Expand All @@ -16,7 +16,7 @@ const gradientColors = (

for (let i = 0; i < step; i++) {
colors.push(
rgbToHex(
rgbaToHex(
~~(rStep * i + sColor[0]),
~~(gStep * i + sColor[1]),
~~(bStep * i + sColor[2])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ const rgbaToHex = (
const hex = `${(red | (1 << 8)).toString(16).slice(1)}${(green | (1 << 8))
.toString(16)
.slice(1)}${(blue | (1 << 8)).toString(16).slice(1)}`
const colorAlpha = ((alpha * 255) | (1 << 8)).toString(16).slice(1)
const colorAlpha =
alpha === 1 ? '' : ((alpha * 255) | (1 << 8)).toString(16).slice(1)

return hex + colorAlpha
return `${hex}${colorAlpha}`
}

export default rgbaToHex

0 comments on commit 19a8266

Please sign in to comment.