You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.
If the config useAlpha=true has been set, an alpha value of 1 is excluded from the result. This is a bug because it means that the tool returns RGBA formatted data only when there is an alpha value less than one, but if the alpha is 1 (100% opaque) then the result format is changed to simple RGB.
While this functionality may be acceptable for some loosely-defined use cases (web designers), it is opinionated compared to earlier versions of colorpicker and now violates the rule of lease surprise.
If this is truly intended(?) by the author, there should be a way to enforce that the format selected in the options is the one used. ie. forceFormat: true
Context
bootstrap-colorpicker version: 3.2.0
bootstrap version: 4.5.3
jQuery version: 3.5.1
Browser name and version: Crome/Brave Chromium 87.0.4280.88 (Official Build) (x86_64)
Operative System name an version: OSX 10.15.7
Expected behavior
The flags userAlpha and format when used in combination should ALWAYS set the result value to an RGBA formatted string.
FYI This arose because my current use case for the tool is for data entry of engineering specs. Web designers and artists don't really care if the results are consistent, but if you record the form results in a data set to be used by an engineer or hard scientist, then mixed formats result in errors.
Of course you can do some regexp massage on the results to add a 1, but that is not ideal.
(If there is agreement in this change I would be willing to make a PR)
Description
If the config
useAlpha=true
has been set, an alpha value of 1 is excluded from the result. This is a bug because it means that the tool returns RGBA formatted data only when there is an alpha value less than one, but if the alpha is 1 (100% opaque) then the result format is changed to simple RGB.While this functionality may be acceptable for some loosely-defined use cases (web designers), it is opinionated compared to earlier versions of colorpicker and now violates the rule of lease surprise.
If this is truly intended(?) by the author, there should be a way to enforce that the format selected in the options is the one used. ie.
forceFormat: true
Context
Expected behavior
The flags userAlpha and format when used in combination should ALWAYS set the result value to an RGBA formatted string.
Actual behavior
The format of the returned string becomes RBG (no alpha) if the alpha value is 1
Live Example
This is visible on the project's own demo page on any of the examples that return RGB(and sometimes A)
https://itsjavi.com/bootstrap-colorpicker/tutorial-Basics.html
The text was updated successfully, but these errors were encountered: