I've made a HLSL shader (fx format) and would like to add a enum/list paremeter to its UI - as a better alternative to the list of boolean flags.
So instead of :
[x] "Use custom map"
[x] "Use custom map alpha"
[x] "Use diffuse alpha"
[x] "Use specular alpha"
[x] "Use normal alpha"
have:
Source: [ "Use custom map" ]
with all 5 choices and the index to selected item on the code level.
"DirectX Standard Annotations and Semantics Reference" mentions about the ListPicker widget but I can't find any example or description how to use it.
The questions are:
Is it possible to have a custom dropdown-like widget in the shader's UI?
How to achieve it?
SAS allows you to set parameters like these but it is entirely ignore by the shader itself. It is purely meta-data for another system to use if/when it needs too ... it does NOT handle rendering of the UI. If you want a UI then you have to read this semantic & annotation data and use it to draw a UI. Either that or use an application that recognises the semantics/annotations structure ...
Related
Material.io has this great tool called the Material Palette Generator: https://material.io/design/color/#tools-for-picking-colors. Using it, you can pick a primary and secondary color, and then click a link "View in Color Tool" which takes you to a page where you can see your choices in different ways: https://material.io/resources/color/#!/?view.left=0&view.right=0&primary.color=6002ee&secondary.color=c63131.
But there doesn't seem to be an easy way of exporting your palette into a format usable for generating a custom Angular Material theme. They have an export link, but the closest format seems to be CodePen. But once you open it in CodePen, the CSS doesn't seem to have the palette information you need.
My question: has anyone tried these tools, and is there a pre-established pathway from Material palette to Angular Material custom theme? Or are they unrelated? If unrelated, is there a simple way to copy the color codes needed from the former to the latter?
Thanks.
You can use this website for generate a material color. For you only need a hex code, and after this you can generate the expected color format.
Expected color format:
Generated result:
If I refer to Material Design guidelines about Colors, they define :
Primary
Primary Variant
Secondary
Secondary Variant
Background
Surface
Error
Angular material define
Primary
Secondary
Warn
In addition the contrast color in angular is the equivalent of the On* in MDC.
1> In Angular Material background and surface are set to white or black depending of the theme builder function. No access for custom.
[edit] (thanks #G. Tranter):
Custom background color here
2> In Angular Material, I can define lighter and darker variant of each of the 3 colors, but I do not have control of where those variants are used !
(unless I manually overwrite each mat-* class...)
I am able to build my theme with two colors (primary and accent). But I don't get the point to define variants if I cannot assign the variants to specific UI elements.
[edit] (thanks #G. Tranter):
In Angular Material the use of variants is defined by the component itself.
If I refer to Material design examples (same page linked above) I cannot reproduce the theme with primary, primary variant and secondary for example...
did I miss something ? or does someone can enlighten me about this 2 major restrictions in theming ?
[edit] (thanks #G. Tranter):
In Angular Material we can define a second theme (with Primary and Accent colors) that will be applied to a specific CSS class
.item-second-theme {
#include angular-material-theme($second-theme);
}
Neither is actually a restriction (at least completely).
You can customize the foreground and background by modifying the theme before you apply it to your application and to Angular Material. See this post. However, it is probably not a great idea from a Material Design point of view to use background and foreground palettes that don't follow the guidelines, so there's usually no reason to not use the default ones in Angular Material.
You can't control how Angular Material components use the variants - that is part of the design of the components themselves. But you can control what those variants are when you create your palettes. For example:
$primary-palette: mat-palette($mat-blue, 500, 100, 700); // default
or
$primary-palette: mat-palette($mat-blue, 700, 300, 900); // darker
And of course you have complete control within your own components as to how shades are used.
how do I changed the color for significant lines in SPSS model viewer for nonparametric results?
currently, the display is in orange lines. I dont see any options in Edit> Options > Viewer > Model Viewer.
If you change your preference setting in Edit > Options > Output to "pivot tables and charts", the output will appear in traditional form. You can double click a chart, which opens it in the Graphboard editor (rather than the more familiar Chart Editor), where some editing is possible. However, chart elements that are structural, i.e., that come from the chart logic, generally cannot be changed as this could violate the chart integrity.
It would be better if the Graphboard Stylesheet option choices applied to these charts, but currently they don't. It is possible to edit the standard stylesheet, but this is quite difficult and I wouldn't recommend it. I'm not sure that even then it would affect these charts.
Does anyone know if you are able to set the colour of the text for a vertex label in JUNG.
I'm using the Visualisation Viewer and can seem to be able to set the colour for everything else.
vv = new VisualizationViewer<String,Integer>(treeLayout, new Dimension(410,557));
Transformer<String,Paint> vertexPaint = new Transformer<String,Paint>() {
public Paint transform(String b) {
return Color.orange;
}
};
vv.setBackground(Color.white);
vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line());
vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller());
vv.getRenderContext().setVertexFillPaintTransformer(vertexPaint);
//vv.getRenderContext().setVertexFontTransformer(vertexFont);
// add a listener for ToolTips
vv.setVertexToolTipTransformer(new ToStringLabeller());
vv.getRenderContext().setArrowFillPaintTransformer(new ConstantTransformer(Color.WHITE));
The DefaultVertexLabelRenderer and the DefaultEdgeLabelRenderer extend JLabel (it is similar to the way cell renderers work in JTable and JTree).
By default, it uses the foreground color of the VisualizationViewer to draw the label text.
vv.setForegroundColor(Color.red);
will make all of your labels red.
This approach is less expensive than making all of the labels parse HTML.
Sorry that the solution is so obscure.
Additionally, since the default renderers extend JLabel, the use of html is the same as it is for JLabel. There are good online resources to show examples of using html with javax.swing. What's missing is documentation to make the connection between using html in JUNG and using html in javax.swing.
You can use HTML in the label to specify the color; an example is here: https://stackoverflow.com/a/2017576/664856
In your case,
vv.getRenderContext().setVertexLabelRenderer(new DefaultVertexLabelRenderer(Color.RED));
should work (if you wanted selected vertex to be Red). I tested it myself. This applies to the selected vertex.
Upon inspection of code, I would have to believe that the link I provided does correctly work for those vertices which are not selected, but I did not actually try implementing that link.
I saw this picture and now wondering if/how you can do this in Delphi. The highlighted/selected text shows two forms of formatting, i.e. highlight color and hash lines.
http://img9.imageshack.us/img9/4121/easilyselecttextofonela.jpg
I've done something very similar recently in a bible application, also done in Delphi.
The user can select a single verse and single words of the selected verses. (But this feature is not released yet, so don't bother looking for it)
I used the web browser control from Microsoft and added my own kind of selection handling.
I've done the formatting by enclosing the relevant parts with span elements and changing their CSS style. When the selection gets removed, I also remove the enclosing elements.
The hard part was backing the "visual" selections with a selection data structure and handling all the selection events (clicking, shift-clicking, shift-ctrl-clicking, ...)
Embedding IE seems to be an easier way to do this as DR says, but you can also do this manually by drawing it all on a canvas, an easy way would be to create two bitmaps (one without a selection and another selected (could be as complicated as you like - dashed, colored, ... )), and you need to know the positions/rects of all your characters which would be somewhat difficult for long texts.
You basically show the unselected bitmap, and overlap the selected parts by portions of the second image.
You would also need to handle the selection manually by OnMouseDown, OnMouseMove, OnMouseUp...