Added rounding of alpha-input to color_from_rgba

This commit is contained in:
DrMaxNix 2021-02-21 20:46:54 +01:00 committed by GitHub
parent cc82988733
commit 7542d9fab3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/*! Pixelimg.js v1.0.0 | (c) DrMaxNix 2021 | www.drmaxnix.de */
/*! Pixelimg.js v1.0.1 | (c) DrMaxNix 2021 | www.drmaxnix.de */
class Pixelimg {
/*
@ -124,7 +124,7 @@ class Pixelimg {
Get pixelimg-compatible rgba color from rgba-values
*/
static color_from_rgba(R, G, B, A){
return {r:R, g:G, b:B, a:(A * 255)};
return {r:R, g:G, b:B, a:Math.round(A * 255)};
}
/*