دیاریکردنی ره نگ

دۆزینەوە و کۆپی کردنی رەنگەکان

رەنگی هەڵبژێردراو
R 102
G 126
B 234
کۆد بۆ بەرنامەسازان
CSS
.my-element {
    background-color: #667EEA;
    color: rgb(102, 126, 234);
    border-color: hsl(230, 75%, 66%);
}
JavaScript
// Using HEX
element.style.backgroundColor = '#667EEA';

// Using RGB
element.style.color = 'rgb(102, 126, 234)';

// Using HSL
element.style.borderColor = 'hsl(230, 75%, 66%)';
Python
# Using RGB tuple
color_rgb = (102, 126, 234)

# Using HEX
color_hex = '#667EEA'

# For matplotlib
plt.plot(x, y, color='#667EEA')
Java
// Using Color class
Color myColor = new Color(102, 126, 234);

// For JavaFX
Paint paint = Color.rgb(102, 126, 234);
Swift
// Using UIColor
let myColor = UIColor(red: 0.4, green: 0.494, blue: 0.918, alpha: 1.0)

// Using HEX
let hexColor = UIColor(hex: "#667EEA")
Kotlin
// Using Color class
val myColor = Color(102, 126, 234)

// For Android
val colorInt = Color.rgb(102, 126, 234)
C++
// Using struct
struct Color {
    int r = 102;
    int g = 126;
    int b = 234;
};

// For SFML
sf::Color color(102, 126, 234);
C#
// Using Color struct
Color myColor = Color.FromRgb(102, 126, 234);

// Using HEX
Color hexColor = ColorTranslator.FromHtml("#667EEA");
PHP
// Using array
$color = [
    'r' => 102,
    'g' => 126,
    'b' => 234
];

// Using HEX
$hexColor = '#667EEA';
Go
// Using color package
import "image/color"

myColor := color.RGBA{
    R: 102,
    G: 126,
    B: 234,
    A: 255,
}