cancel
Showing results for 
Search instead for 
Did you mean: 
Stefan_Wolfrum
Level 2
29 17 1 1
Message 1 of 5
611
Flag Post

Solved!

Syntax of Prime App variables?

HP Recommended
HP Prime
macOS 10.15 Catalina

Guys (Joe, Tim?),

 

I just studied an App program for the Prime that is derived from the "statistics 1Var" App. In it's Plot() function it sets up the symbolic data for the plot by stating

H1 := {"D1","D2",1,0,#FF:24h};

 

Checking interactively the Symb view of that App I can reverse engineer that the first two entries of that list correspond to the first two parameters of such a plot: the independent column and the frequency column.

The next two entries in the H1 list variable, 1 and 0, obviously correspond to the plot type and the plot option. I *assume* those are just integers and the 1 (plot type) stands for "Histogram", a 2 would stand for "Box Whisker" and so forth, right? Same for plot options.

The last entry of that H1 list above obviously stands for the color. But what's that strange format?

I reverse-engineered that #FF:24h stands for blue, #FF00:24h stands for (light/full) green and #FF0000:24h stands for red.

What's with the ":24h" at the end of these color values that are obviously similar to how CSS colors are defined?

 

But the point of my question is: where is all this documented? I searched the latest user guide but neither found the definition of such a H1 list in the chapter about the Statistics 1Var App nor in the chapter about programming Apps. 😞

 

And H1 for Statistics 1Var ist just one example. What about all the other variables that define plots via the symbolic view for all the other apps? Where are they documented?

 

Thanks,

Stefan.

0 Kudos
4 REPLIES 4
Joe_Horn
Level 8
624 611 118 208
Message 2 of 5
Flag Post
HP Recommended

But the point of my question is: where is all this documented? I searched the latest user guide but neither found the definition of such a H1 list in the chapter about the Statistics 1Var App nor in the chapter about programming Apps.

 

It's documented in the current edition of the User Guide on page 671, which is the section about App Vars, with H1-H5 being under the heading "Symbolic View Variables".  All is explained there except the reason for the ":24h" which simply means that colors are 24-bit binary integers.  (Whenever a binary integer is displayed in Home, its wordsize is also shown except when it happens to be the same as the system wordsize which the user can adjust in Home Settings.)  See the RGB command's help screen for information about how to turn color values into Prime binary integer color numbers, e.g. RGB(0,0,255) returns the Prime number for blue, namely #FFh.  Hmmm... Apparently the RGB command always returns 32-bit words, for some arcane reason.

 

All the other app's variables are in that section of the manual too.  Hope this helps!

-Joe-
Stefan_Wolfrum
Author
Level 2
29 17 1 1
Message 3 of 5
Flag Post
HP Recommended

Excellent, Joe! As always: you‘re the best! 🤗

I don‘t know why I didn‘t see that in the manual in the first place. 🤷‍

 

Does this mean that colors for symbolic App variables cannot contain alpha values / transparency?

0 Kudos
Joe_Horn
Level 8
624 611 118 208
Message 4 of 5
Flag Post
HP Recommended

Although the bits are allocated for alpha transparency in Prime's colors encoded as binary integers (the allocation is #AARRGGBBh, where AA are two nibbles allocated for alpha level, RR is two nibbles allocated for red, and so on) but I have no idea whether or not alpha transparency is actually supported by any of the apps.  Try it and tell us! 😀 Meanwhile, maybe Tim or Cyrille can tell us more about how well Prime currently supports alpha transparency.

-Joe-
0 Kudos
cyrille
Level 6
Level 6
252 251 42 77
Message 5 of 5
Flag Post
HP Recommended

Hello,

 

Most drawing primitives do support alpha, but I do not remember having this turned on for things like math graphic drawins...

 

Cyrille

I am an HP Employee
0 Kudos
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation