Listado de la etiqueta: Color


Ubuntu Yaru orange recolor

For the upcoming Ubuntu 22.04 release, the Yaru developers are removing the aubergine (eggplant) color from the default Ubuntu theme, replacing it with orange, since libadwaita will only allow Ubuntu to use one accent color.

The work for this has already started, with orange now being used throughout the Yaru GTK and GNOME Shell theme for every element that was previously aubergine – sliders, switches, checkboxes, etc. What’s more, the orange from the window close button was also removed, I assume also due to libadwaita.

This is how Yaru GTK light and dark themes look right now (from Git), after replacing aubergine with orange:

Ubuntu Yaru orange recolor

Ubuntu Yaru orange recolor

Previously (this is the theme used in Ubuntu 21.10), with both aubergine and orange accent colors, the theme looked like this – also notice the close button differences:

Ubuntu Yaru theme aubergine

Ubuntu Yaru theme aubergine

Some icons have also been recolored to use orange instead of aubergine, like the GNOME Tweaks (you can see the new Tweaks icon in the screenshot at the top of the article, on the left dock) and speaker icons.

For now, the folder icons continue to use aubergine, and they might stay like this in the future. The same goes for the desktop wallpaper. As for the login screen background, I couldn’t find any information about it.

If you want to give this a try, you’ll need to build the latest Yaru from git.

What do you think? Do you like the theme with both orange and aubergine accents, or the new orange-only accent?


Colors and animations are widely used on websites built by HTML scripting to make them more pleasing and aesthetic. Sometimes, these colors could be seen quickly changing at some element of HTML. This would happen because of the use of “setInterval” functions. Some of you may have thought about randomly changing the colors of HTML elements while doing HTML scripting. You may have thought about some pure way to do that but could not find the solution. If so, this article is for you to gain expertise on changing the color of any element of HTML randomly.

Example # 01

Let’s get started with the first example of this article by demonstrating the use of the simple pick color function to generate random colors on HTML elements. This example code started from the HTML main tag followed by the empty head tag. We have been using the body tag to define the body elements of this HTML page, followed by the script tag containing JavaScript styling to make this page aesthetic and styled. The body text has been aligned to the center using the “text-align” property within the inline style tag. Two headings of size 1 have been used here.

The first heading uses inline styling to color itself green using the color property. While the second heading has been specified with the ID “pick” and the inline styling tag to color it red for a while via the “color” property. After this, the button tag is used with the onclick attribute getting the return value from the “pickColor()” function to specify which color must be displayed upon tapping this button. Here comes the JavaScript code for this HTML script to make it dynamic. It contains the script tag followed by the use of function definition for the “pickColor” method. This method has been initializing an array “Col” taking different colors within it, i.e., using the specific color numbers.

Another variable, “random_color”, has been used to get the random color from the “Col” array by applying the “floor” and “random” functions of the Math library. Whatever the “floor” value has been calculated, it would be used to get the random color from the specific index of this array. The ID “pick” of heading 2 for this HTML file has been used to get the ID and saved to the variable “x”. After that, the style attribute “color” was applied to the variable “x” to randomly color heading 2 using the “random_color” variable. This is it about this code. Let’s save it and run it with the “Run” menu.

The output in the Chrome browser is shown in the following image. It shows two headings followed by a simple button. The first heading is static, while the second heading has been used to randomly change its color whenever a user taps on the button.

Before tapping the button, the color of the heading was red. After tapping on it, it turns out as shown below, i.e., light orange:

Again tapping on the button, the color of the heading turns yellow.

Tapping on the button merienda again changes the color of the heading to green.

Like this, each tap on the button would randomly change the color of a heading, i.e., blue, green, yellow, etc.

Example # 02

Let’s get started with the advanced example of randomly changing the color of some element from the HTML file. We have created an HTML file that will randomly change the color of some headings after each second without using any button or tapping on the section. Also, we will be creating a random “div” section and filling it with any random color upon clicking on any area of the HTML page. We suggest you read the explanation for the “body” tag first and then go through this section of the HTML page explanation. The HTML file started with the style tag to color the different HTML elements on this webpage. The “#color” ID has been used to set the width and height of the “smallest” input “div” to 10em and 6em, respectively. The heading 1, heading 4, and paragraph font family have been set to sans-serif. The text has been aligned to the center. While the “box” class has been specified to set the width, height, align-items, and justify-content property for the second “div” section to 100%, 33vh, center, and center, respectively. The styling has been done here:


Within the JavaScript code of this file, we have been calling the “setInterval” function by passing it a random color with the help of a “setColor” function after each millisecond. The function “setColor” has been taking the random color using the “randomeHexaDecimalColorString()” function, getting the ID of the first “div” section, and applying the random color on the particular “div”. The function “changeColor” has been used here to create an array of colors and randomly choose one color from its array by a “floor” method.

This would be applied to the inner “div” section of the second “div” element of the body to randomly change the color of a “div” box. The function “rgbColor” has been used to initialize the value for red, green, and blue colors while using the previous “randomNumber” function.

Th randomHexaDecimalColorString() function would be getting the value for the red, green, and blue combination using the “toString” and “padStart” function and return to its calling function. The changeColorRandomly() function is again using the randomHexaDecimalColorString() function to change the color of a box according to the color number specified by the ID “text”. The “clickHandler” function is used to randomly change the color of a box when clicked on anywhere in the section.

The HTML “body” tag contains the inline styling to align the text. It contains the center via the use of the “text-align” property. We have two main “div” elements to divide the page into 2 sections. The first one contains the ID “automóvil” for differentiation, while the other one contains the class “box”. The first “div” section only contains a single heading of size 1 with its unique heading title. The other “div” section contains another “div” in it that has been using the “p” HTML element to add the paragraph of 1 line and the “input” tag element to get the color ID as input and change the color of this “div” according to that.

Along with that, the h4 heading of this “div” section would use the ID “text” to randomly change the color number with each click on the HTML page. Let’s save and run the following code:

The first heading would change its color after each millisecond. While clicking on the HTML page’s second “div” section, the box will also change its color randomly.



Conclusion

This is about using simple techniques to randomly change the color of some HTML elements without hard work. In our examples, we have tried to cover the use of the “pickColor” function to randomly pick one color from an array and apply it to the specific element. We have been attempting to implement the function setInterval() to instantly change the color of a specific element without tapping somewhere on the HTML screen, i.e., automatic color change.



Source link


The colors in life, either in nature or in front of the computer screen, have a great effect on the human mind as they can change the mood from dull to energetic and also from energetic to dull. If you are an Ubuntu user, then you can observe the default color of the folder icons present in different directories is blackish or sometimes purple color, as shown in the image below:

In this write-up, we will discover the method by which we can change the color of the folder colors in the new release of Ubuntu 22.04.

How to change the folder color in Ubuntu 22.04

To change the color of the folders in Ubuntu, we have to add the PPA repository of the package of Yaru-color-theme to the default repository list of the Ubuntu:

$ sudo add-apt-repository ppa:costales/yaru-colors-folder-color

When the PPA repository has been added to the Ubuntu’s default repository list, we will use update the system:

Now with the help of the apt package manager, we will install the yaru-colors-folder-color package whose repository has been added in the previous commands:

$ sudo apt install yaru-colors-folder-color folder-color  -y

Now we will quit the file manager “nautilus” by using the flag “q”:

When the package is installed successfully, we can navigate to any directory and right-click on any folder, for example, we will right-click on the “object” folder, and context menu will appear, choose the “Folder’s Color” option:

Another list will be open containing different colors, choose the color you want to set on the folder, for example, we have chosen the green color:

The color of the “object” folder has changed to green color:

Similarly, you can change the color of any folder to any other color.

Conclusion

If you are bored with the default look of Ubuntu, then you can change the color of the folders. In this guide, we have provided the method of changing the colors of folders of Ubuntu by simply installing the folder-color package, after installing it folder colors can be changed to any color.



Source link