You want to convert a string that contains hex value to a decimal? How can you do that?
For example:
var x="#fffffa"
You can't convert this type of string into decimal-number. Reason: because there is a pound (#) sign inside that string. Solution: remove the pound sign first.
This case is retrieving value from <input type="color">
For example:
var x="#fffffa"
You can't convert this type of string into decimal-number. Reason: because there is a pound (#) sign inside that string. Solution: remove the pound sign first.
This case is retrieving value from <input type="color">
No comments:
Post a Comment