WEBVTT

00:00.640 --> 00:08.280
We can modify how our string draws using what are called attributes.

00:08.530 --> 00:14.160
So right now I have just the basic hello world example in.

00:14.240 --> 00:15.940
It says Hello everyone.

00:16.660 --> 00:21.190
So let's actually change how we draw this.

00:21.190 --> 00:22.360
Hello everyone.

00:23.130 --> 00:29.380
So to do that we're going to use attributes and to use attributes.

00:29.460 --> 00:38.040
All you have to do is you have to say at Tron or ADT are in.

00:38.430 --> 00:41.520
And then you can pick the attribute you want.

00:41.520 --> 00:47.120
So I would say stand out in doubt.

00:48.680 --> 00:49.410
OK.

00:49.600 --> 01:00.670
And everything everything we draw after this line this this attribute on we'll use this standout attribute

01:00.790 --> 01:03.830
to draw or run this.

01:04.180 --> 01:06.790
See how it changed how it drew.

01:07.080 --> 01:12.480
And now it's kind of has a black background with white text in the middle.

01:13.300 --> 01:16.520
And we can change or we can do more attributes

01:18.990 --> 01:26.910
say to you can you make it bold say

01:30.480 --> 01:32.420
this.

01:32.460 --> 01:39.330
Now it's it's hard probably hard to see but it's actually a little bit more it's a bit bigger.

01:39.540 --> 01:53.340
It's all and you can actually show you all the attributes you can actually use here.

01:55.370 --> 01:55.750
OK.

01:55.920 --> 02:05.640
So you actually have quite a few different attributes you can use and all you actually play around with

02:05.640 --> 02:16.060
it if you want but how you want to turn off attributes is through a t t r o f f.

02:16.110 --> 02:29.830
So if I wanted to turn off stand out keep hold and maybe draw this in say maybe on

02:32.690 --> 02:33.350
line

02:36.150 --> 02:37.650
and try this.

02:37.660 --> 02:47.120
So you see it's using the stand out and bold to draw the first one but just the bowl old to draw second.

02:47.570 --> 02:57.270
So that's kind of how we can draw and modify our text using attributes.

02:57.320 --> 03:04.700
And there's actually more attributes we can use here to get this

03:07.540 --> 03:11.030
and those attributes are actually coloreds.

03:11.080 --> 03:24.690
So how to draw colors is first we have to see if our council actually allows recolors So how we do that

03:24.750 --> 03:30.340
is a if not not has colors.

03:30.660 --> 03:36.450
So if we don't have colors unable for a con. we're going to exit out

03:39.060 --> 03:52.710
this Riskin say hey consul doesn't it's for CH colour's do that

03:59.360 --> 04:02.790
and all that and then we'll kind of just turns.

04:03.090 --> 04:07.430
OK so if it gets to here then we know it does sparklers.

04:07.520 --> 04:15.110
So how to start using colors is we call this starch color

04:18.820 --> 04:21.350
colors always come in pairs.

04:21.610 --> 04:29.000
So meaning there will be a color for the text and color for the background.

04:29.440 --> 04:35.620
And you kind of set to set some color pairs.

04:35.620 --> 04:36.740
We do this.

04:36.820 --> 04:53.690
So in that pair and we'll say one and let's go hopefully something you can read and see color red and

04:53.740 --> 04:57.440
put it on a black background color block

05:00.080 --> 05:09.290
and this and so essentially what this will do is it'll set the first color pair.

05:09.300 --> 05:17.800
So we get to choose what is to be red on black.

05:17.880 --> 05:20.700
They even see the values.

05:20.700 --> 05:25.390
Black is zero and red is one.

05:26.490 --> 05:31.260
And then this just sets the actual color pair.

05:31.410 --> 05:39.010
So you actually use the color pair we say Tron and then we'll see color.

05:39.850 --> 05:42.900
Pair and then we give it the one we want.

05:42.900 --> 05:46.850
So we're set one here so we're going to use one.

05:47.220 --> 05:49.050
And if I run this

05:56.210 --> 06:01.560
recolors sorry has cutlers.

06:02.770 --> 06:09.550
You'll see it's a black background with in this case it's inverted text.

06:09.580 --> 06:19.280
So the stand out makes it so that there's all kind of red red box around her text.

06:19.290 --> 06:20.850
It says hello or one.

06:21.170 --> 06:22.250
OK.

06:22.330 --> 06:31.030
So if you want to play around with this little bit more let me show you the colors that curses gives

06:31.030 --> 06:34.290
us here.

06:36.170 --> 06:47.940
So we have black green yellow blue magenta cyan so play around with the different colors and the different

06:47.940 --> 06:52.150
attributes and see kind of what you can make.

06:52.230 --> 07:00.840
So in the next lecture I want to go over making a new utility library just for cursus.
