Doc Manifest fontColor rgb values "out of bounds"
Opened this issue · 3 comments
pdkn commented
Expected Behaviour
manifest fontColor rgb values to be either 0-1 or 0-255
Actual Behaviour
manifest fontColor rgb value range is 0-30000
i.e
"fontAvailable": false,
"fontColor": {
"rgb": {
"blue": 5582,
"green": 5582,
"red": 27370
}
},
Reproduce Scenario (including but not limited to)
psd with a textLayer and font color of #d52b2b
(r:213, g:43, b:43)
Steps to Reproduce
generate manifest and see rgb value
Platform and Version
All
Sample Code that illustrates the problem
na
Logs taken while reproducing problem
na
johnleetran commented
Thanks for this feedback. the values returned are 16-bit values, and seems like we could consider returning 8-bit values
pdkn commented
Updating a color via documentOperation
seems to take an 8-bit value. So for consistency having documentManifest
return an 8-bit value would make sense? Bonus points if we could also (optionally) set color as a hex value to avoid conversions for other systems (similar to jsx)?
"fontAvailable": false,
"fontColor": {
"rgb":{
"hexValue": "#d52b2b"
}
},
pdkn commented
FYI, the current workaround to convert the number is as follows
const manifestRgb = {
"blue": 5582,
"green": 5582,
"red": 27370
}
const rgb = {
"blue": manifestRgb.blue >> 7,
"green": manifestRgb.green >> 7,
"red": manifestRgb.red >> 7
}
result
rgb = {
"blue": 43,
"green": 43,
"red": 213
}