Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Javascript Articles
Page 209 of 534
How to convert 3-digit color code to 6-digit color code using JavaScript?
In this tutorial, we will see how to convert 3-digit color code to 6-digit color code in JavaScript. A 3-digit hex color code represents colors in #RGB format, where each digit controls red, green, and blue values. To convert to 6-digit format, we duplicate each character: #RGB becomes #RRGGBB. For example: 3-digit: #08c 6-digit: #0088cc 3-digit: #f4a 6-digit: #ff44aa Algorithm Step 1: Check if the input length is exactly 3 characters Step 2: Split the string into individual characters using split("") Step 3: Use map() to duplicate each character ...
Read MoreDifference between Python and JavaScript
JavaScript makes webpages interactive by working alongside HTML and CSS to improve functionality. It validates forms, creates interactive maps, and displays dynamic charts. When a webpage loads, the JavaScript engine in the browser executes the code after HTML and CSS have been downloaded, allowing real-time updates to the user interface. Modern JavaScript engines use just-in-time compilation, converting JavaScript code into bytecode for faster execution compared to traditional interpreters. Python is a general-purpose, high-level programming language created by Guido Van Rossum in 1989 and released in 1991. It's widely used for web development, machine learning, and software development, making ...
Read MoreHow to add dashed stroke to a Textbox using FabricJS?
In this tutorial, we are going to learn how to add a dashed stroke to a Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. The strokeDashArray property allows us to specify a dash pattern for the object's stroke. Syntax new fabric.Textbox(text: String, { strokeDashArray: Array }: Object) Parameters text − This parameter accepts ...
Read MoreHow to add stroke to a Textbox using FabricJS?
In this tutorial, we are going to learn how to add stroke to a Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. Our textbox object can be customized in various ways like changing its dimensions, adding a background colour, or by changing the colour of the line drawn around the object. We can do this by using the stroke property. Syntax new fabric.Textbox(text: String, { stroke : ...
Read MoreHow to change the font size of a Textbox using FabricJS?
In this tutorial, we are going to see how to change the font size of a Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. The font size specifies how large or small the characters displayed in our textbox should be. We can change the font size by using the fontSize property. Syntax new fabric.Textbox(text: String, { fontSize: Number }: Object) Parameters ...
Read MoreHow to change the font style of a Textbox using FabricJS?
In this tutorial, we are going to see how to change the font style of a Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. Font style refers to the style of characters typed within a textbox. Syntax new fabric.Textbox(text: String, { fontStyle: String }: Object) Parameters text − This parameter accepts a String ...
Read MoreHow to change the font weight of a Textbox using FabricJS?
In this tutorial, we are going to see how to change the font weight of a Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. Font weight refers to the value which determines how bold or light our text will appear. Syntax new fabric.Textbox(text: String, { fontWeight: Number|String }: Object) Parameters text − This ...
Read MoreHow to create a canvas with Textbox using FabricJS?
In this tutorial, we are going to learn about how to create a canvas with a Textbox object using FabricJS. We can customize, stretch or move around the text written in a textbox. We can also customize the text itself by using properties like fontSize, fontFamily, fontStyle, fontWeight, etc. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. Syntax new fabric.Textbox(text: String, options: Object) Parameters text − This parameter accepts a String which is the text string ...
Read MoreHow to create a Textbox with background colour using FabricJS?
In this tutorial, we are going to create a Textbox with background colour using FabricJS. We can customize, stretch or move around the text written in a textbox. We can also customize the text itself by using properties like fontSize, fontFamily, fontStyle, fontWeight etc. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. The backgroundColor property allows us to assign a colour to our object's background and it is rectangular in shape for the textbox. Syntax new fabric.Textbox(text: String, { backgroundColor: String }: Object) ...
Read MoreHow to create a Textbox with border colour using FabricJS?
In this article, we are going to create a Textbox with border colour using FabricJS. We can customize, stretch or move around the text written in a textbox. We can also customize the text itself by using properties like fontSize, fontFamily, fontStyle, fontWeight etc. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. One of the properties that FabricJS provides is borderColor which allows us to manipulate the colour of the border when our object is active. Syntax new fabric.Textbox(text: String, { borderColor: String ...
Read More