Why won't it let me change the value of a property of an object? - inform7

I have this code and the commented line breaks it. What have a done wrong here? I know I can just say pen can be red, green, or blue; but I want to use the value color or something like it to share the property with other objects.
NicePlace is a room. "Its a pretty nice place."
A color is a kind of value.
The colors are red, green, blue.
A pen is a kind of thing.
A pen has a color called pencolor.
A coolpen is a pen.
The pencolor of coolpen is red.
[Now the pencolor of coolpen is blue.]
There is a coolpen in NicePlace.

Phrases like "now ..." must be placed in rules, otherwise Inform doesn't know when to run them. So try this:
When play begins:
Now the pencolor of coolpen is blue.

Related

How to "wash out" colors with CSS filters?

I am trying to use CSS filters to create a "disabled" look for components I am working on. I am trying to make it so that everything is "washed out" a bit. I can create this effect by using opacity(0.75) for components which are on white background: then black becomes gray and all strong colors become a bit more white. But the issue is if the component is not on white background, then opacity does not work as I would like. So how could I use CSS filters to create this "wash out" look? Like to multiply with white color a bit all colors.
I tried contrast but it looks like everything goes to gray, not white (so black stays black much longer than with opacity, while other colors are already washed out).
Using a combination of Contrast and Brightness filters might give you what you need:
filter: contrast(30%) brightness(150%);

Opacity Levels in Android Studio

I’ve searched and I haven’t found a way to get a certain level of transparency in a colored button while the text of the button is 100% visible.
There has been options to get certain levels of transparency in a button, but the text also becomes transparent and that’s not what I want.
Any pointers?
Do do it in code, you can use:
yourButtonName.getBackground().setAlpha(int alpha)
where alpha is an int between 0 and 255.
Do do it in XML, you would add something like this to your button attributes:
android:background="#8000FF00"
This would yield a 50% opaque green color.
To better understand how we arrive at the code "#8000FF00" , look here.
:)

JavaFX: Textarea background color error

Here's the problem:
I tired to make the textarea from javafx have a black color, so i tried to add the parameter:
"-fx-background-color" with the value "black"
It did change something: Around the text area a black border appeared. I tried to change the background size with:
"-fx-background-insets" with the value "100" (for testing purposes, i know there are up to 4 values)
But nothing visual happend.
However, if i set the value to "-100", the screen 100 pixels outwards of the textarea is painted black. So, in theory, reversed parameter delivers the reversed result of what i want.
Therefore i ask: Why is it not working? I looked up other solutions, and they do it with the "-fx-background-color" parameter, so what a i missing here?
Use the following in an external css file:
.text-area .content {
-fx-background-color: black;
}
don't forget to include this css file, either through FXML or through code. You can use this tutorial.
I just found the solution to change the color of the background of TextArea in JavaFX. Write this in your controller class:
textarea.setStyle("-fx-control-inner-background: black;");
I was deep searching on the stackoverflow and eventually found it. The link is given below: Textarea javaFx Color
Happy coding!

CSS change child colors based on math?

Alright, I'll admit that title seems a bit cryptic, but here's the situation:
I have a list of actors on a page with photos and short bios, each one is its own <div>. Let's say that I have seven actors on my page, and I want the text colors in their boxes to change, say, to create a rainbow, so actor 1 would be red, 2 would be orange, 3 would be yellow, and so on. Can I do this without having to manually specify style="color:rgb(whatever)" on every div? Let's say I want the color values to change dynamically if I add more people to the list or take them away, so I'd specify a beginning color value of rgb(255,0,0) for red and and end value of rgb(255,0,255) for violet and somehow fill in the rest, so that each subsequent box has a different text color but all together they make a rainbow.
...or would I be forced to use JavaScript to do this?
No you need not required to red color manually you can use CSS nth-child selectors please check below tutorial
Click here!

How can I shortcut the color #F4F4F4?

I'm already using shortcuts for example #EEEEEE changed to #EEE
Is there any way that I can shortcut colors such as F4F4F4 using CSS
Hope someone has the answer
No.
As you noted, colors on the form #xxyyzz can be shortened to #xyz, but there is no shorthand notation for colors where the red, green and blue components are all equal.
Not really.
F4F4F4 is shorter than RGB(244,244,244), if it's any consolation :)
No you cant, only colors where the hex represntatino of each color (RGB) consits of to equal characters can be shortened.
read about it here http://www.websiteoptimization.com/speed/tweak/hex/
there are also names for certain colors (red, blue, lightblue,etc). pretty much actually, but i dont think your color is among them. read about that here: http://www.w3schools.com/css/css_colornames.asp

Resources