Using light color in Lazarus (Pascal, crt) - pascal

Does anyone know a way to use light colors in Lazarus?
I'm using the crt library, which says that, for example, 2=Green and 10=LightGreen.
TextBackground(2);
clrscr;
readln;
TextBackground(10);
clrscr;
readln;
However, for some reason, in Lazarus they both output the same color (I'm using the above example in a Lazarus simple program with the crt library. Using the identifiers "Green" and "LightGreen" gives the same result).
Does anyone know a way to fix this? Thanks

Answering my own question, because I had solved this sometime after posting, but had forgotten about the question.
I'll start by saying I have NO IDEA why this works, and that I found out about it by accident.
Running this code has given me a white background, and it has worked for any other light colour.
TextBackground(15);
TextColor(Black+ Blink);
ClrScr;
readln;
If anyone could post any explanation as to why this works, I'll be happy to set it as best answer.

Related

How to make Esp32-Cam blink when face is recognized

I've found several tutorials on how to set up a video-streaming server, how to get information, for example the temperature and humidity, via telegram or how to save a face so it gets recognized with Esp32-Cam. But I've found nowhere on the whole internet an example for my problem. I want the Esp32-Cam to light an LED when it recognizes a face. That should be possible, shouldn't it? There are a lot of pins which can be used as output. Does someone have a idea how to do that? When I have the light I want it to rotate a stepper motor too. I'de very grateful for your help :)
kind regards
the andorian guard

create a simple (and visible!) UI slider in Unity 5

![enter image description here][1]please I need some help, this should apparently be something very simple and basic to do, but maybe I'm missing something.
I'm quite newbie to Unity3d, I had no much problem with creating a somewhat flashy 2.D scene (I mean 2D with different layers in Z level), scripts, etc. But I'm having trouble to create a "UI Slider" object: when I create it, it just shows nothing on screen. How can I make it visible? I just need to create a very simple, plain slider whose value can be controlled at runtime by means of a script.
thanks.
Well.. since you give nothing to go on, I suggest that you take a look at a tutorial for the UI:
https://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/using-the-ui-tools
If you have troubles after this tutorial, come back with an example of your problem to make people more willing to sacrifice their time in helping you.
Hope this is somewhat useful
Take a look at the Unity3D docs here.
http://docs.unity3d.com/Manual/script-Slider.html
It should have what you are looking for.

Change image colormap to deuteranopia in Matlab

I've been trying for a long time to change my colormap of my images using a custom 256x3 colormap to switch the impression of a 'normal sighted' person to the one a person with deuteranopia (red-green-blindness) can see.
The colormap has already been created, but in no way I get to apply it to the original image.
The code
load('ColormapsDefVis.mat')
fig=figure
a=imread('Regenbogen.png');
[b map]=rgb2ind(a,256);
c=ind2rgb(b, DeuteranopiaColorMap);
imshow(c);
did not work as well as
load('ColormapsDefVis.mat')
fig=figure
a=imread('Regenbogen.png');
imshow(a);
set(fig,'Colormap',DeuteranopiaColorMap)
did not.
Does anyone know how to change the custom colormap correctly?
I would appreciate your help very much!
The first peice of code works. You have to be making a mistake or interpreting the results wrongly.
I suggest you look a to a thing. Make sure you image is unit8 or single. Additionally, you probably dont what dithering to happen, so I suggest you do rgb2ind(a,256, 'nodither'). The results of the dithering may be fooling your eyes, but we can't know as you didn't post any image.
To convince yourself that rgb2ind works, see the code below. You should be able to test it in you computer.
img=imread('cameraman.tif');
indimg=img;
cmap=hsv(255); % colromap 1
cmap2=cmap(end:-1:1,:); % colromap 2
subplot(121);
c=ind2rgb(indimg,cmap );
imshow(c)
subplot(122);
c2=ind2rgb(indimg,cmap2 );
imshow(c2)
Thank you very much for your help Ander, the approach using colormaps was just not the efficient solution i was looking for. Although I am sure it would work too, there is a way easier solution for the problem :)
To receive the impression of being red-green-blind I took the idea that people suffering from this condition cannot distinguish between reddish and greenish objects. So my solution is to plot the mean from the red and green RGB-image channel in both channels to make them indistinguishable.
a=imread('peppers.png');
figure,
subplot(121)
imshow(a)
c=(a(:,:,1)+a(:,:,2))/2; %Mean value between channel red and green
a(:,:,1)=c; %Switch the red channel to the mean
a(:,:,2)=c; %Switch the green channel to the mean
subplot(122)
imshow(a)
Unfortunately, stackoverflow refuses me to upload images as I do not have enough reputation, but the code shall work using any RGB-image, for example the builtin demo image 'peppers.png'.
Hope this helps anyone else too!

How to find all the colors in a photo with Ruby

Does anyone know of a Ruby library that can list all of the colors in a photo, as well as listing them in order of frequency? Or is it possible that RMagick already can do something like this?
If no one knows of one, how exactly could I get started on making such a tool? I have a great idea for a program I'd love to try, however I just don't know much about image processing as I've never done it.
I'd be very grateful for any tips or info to point me in the right direction! Thanks!
color_histogram

Qt: transparent QRubberBand?

I'm trying to draw a QRubberBand on a QGLWidget. For some reason the area of the rubber band is drawn as opaque and I don't see what's behind it. This kinda beats the purpose of the rubber band as a way to select stuff inside it.
I've seen in docs for QStyleOptionRubberBand that there's an 'opaque' member but I have no idea how to access this in the default style or how to change it.
Anybody ever done this?
Are you in Vista/Win7 with Areo on? If so, does it work when you turn it off?
EDIT:
How about Message #6?
"In the meantime I looked it up in the QT source code, and I noticed that the following will solve my problem: myQRubberBand->setWindowFlags(Qt::ToolTip);"
It would be great having any source code ?
But here are how I would attempt to fix the problem :
Subclass QRubberBand
Redefine PaintEvent method
call iniStyleOption to activate style options of your choice
Hope it helps !

Resources