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
Construct's color values are a bit of a hack: they originated as a way to get an RGB value in to a single number, and at some point we invented a second format, so there's two kinds of color numbers.
I think it would probably be better to entirely replace colors with a better system, perhaps based on strings in CSS color formats, like "#FF0000 and "rgb(255, 0, 0)", "hsl(150 30% 60%)" etc. That would be a bigger task though and might be tricky to handle backwards compatibility.
Possible workarounds or alternatives
Currently, the ColorValue expressions is not a generic color code.
RGB
ColorValue
255, 255, 255
-281492157629439
255, 0, 0
-281474976711679
0, 255, 0
-17179870207
0, 0, 255
-1049599
0, 0, 0
-1023
Possible workarounds or alternatives
Although we can use some special methods to convert ColorValue into RGB, But this is a Hacker.
Based on discussions by R0J0hound, Federico Calchera in the community. This is an Solution example of how to make ColorValue expression can be conver to RGB or Hex.
// Set Global VarconstcolorValue=runtime.globalVars.colorValue;runtime.globalVars.r=convertTo255(C3.GetRValue(colorValue));runtime.globalVars.g=convertTo255(C3.GetGValue(colorValue));runtime.globalVars.b=convertTo255(C3.GetBValue(colorValue));runtime.globalVars.a=convertTo255(C3.GetAValue(colorValue));
Proposed solution
Plan 1:
Support 'HexColorValue' expression. He will return a string of hex colors code. Uppercase, and withou # sign.
FFFFFF
Plan 2:
Support 'ColorValue' expression with parameter.
plan 3:
Add a expression to convert colorValue back to rgbEX
Why is this idea important?
This would make handling color, dynamic palettes, player colors etc much easier. As currently having to transfer colors or needing to store each channel is very painful.
Additional remarks
No response
The text was updated successfully, but these errors were encountered:
Reviewed guidelines
Checked for duplicate suggestions
Summary
The current color expressions are not particularly user-friendly, which causes confusion for many novice users.
Original post:
#83
Possible workarounds or alternatives
Currently, the ColorValue expressions is not a generic color code.
Possible workarounds or alternatives
Although we can use some special methods to convert ColorValue into RGB, But this is a Hacker.
ColorValue Convert.c3p
Based on discussions by R0J0hound, Federico Calchera in the community. This is an Solution example of how to make ColorValue expression can be conver to RGB or Hex.
ColorValueConvert.c3p.zip
Proposed solution
Plan 1:
Support 'HexColorValue' expression. He will return a string of hex colors code. Uppercase, and withou
#
sign.Plan 2:
Support 'ColorValue' expression with parameter.
or
plan 3:
Add a expression to convert
colorValue
back torgbEX
Why is this idea important?
This would make handling color, dynamic palettes, player colors etc much easier. As currently having to transfer colors or needing to store each channel is very painful.
Additional remarks
No response
The text was updated successfully, but these errors were encountered: