Skip to content

Commit

Permalink
Coloris 0.23.0
Browse files Browse the repository at this point in the history
- Remove a workaround for a now fixed Chromium bug where the alpha value is rounded incorrectly (#134)
- More CSS hardening to render the hue and alpha sliders correctly in the presence of some overzealous CSS frameworks
  • Loading branch information
melloware committed Mar 5, 2024
1 parent 4bbbecc commit 4eb0983
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

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

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@melloware/coloris",
"version": "0.22.0",
"version": "0.23.0",
"description": "A lightweight and elegant color picker.",
"author": "Momo Bassit",
"contributors": [
Expand Down Expand Up @@ -46,14 +46,14 @@
"wai-aria"
],
"devDependencies": {
"@babel/core": "^7.16.0",
"@babel/preset-env": "^7.16.0",
"@babel/register": "^7.16.0",
"@babel/core": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@babel/register": "^7.23.7",
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
"gulp-clean-css": "^4.3.0",
"gulp-rename": "^2.0.0",
"gulp-replace": "^1.1.3",
"gulp-replace": "^1.1.4",
"gulp-uglify": "^3.0.2",
"gulp-wrap": "^0.15.0"
},
Expand Down
4 changes: 2 additions & 2 deletions src/coloris.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
background-image: linear-gradient(90deg, rgba(0,0,0,0), currentColor);
}

.clr-hue input,
.clr-alpha input {
.clr-hue input[type="range"],
.clr-alpha input[type="range"] {
position: absolute;
width: calc(100% + 32px);
height: 16px;
Expand Down
5 changes: 1 addition & 4 deletions src/coloris.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2021-2023 Momo Bassit.
* Licensed under the MIT License (MIT)
* https://github.com/mdbassit/Coloris
* Version: 0.22.0
* Version: 0.23.0
* NPM: https://github.com/melloware/coloris-npm
*/

Expand Down Expand Up @@ -841,9 +841,6 @@ return ((window, document, Math, undefined) => {
a: match[6] * 1
};

// Workaround to mitigate a Chromium bug where the alpha value is rounded incorrectly
rgba.a = +rgba.a.toFixed(2);

} else {
match = ctx.fillStyle.replace('#', '').match(/.{2}/g).map(h => parseInt(h, 16));
rgba = {
Expand Down

0 comments on commit 4eb0983

Please sign in to comment.