“rgb ke konversi hex” Kode Jawaban

hex ke fungsi rgb

function hex2RGB(hex){
        const r = parseInt(hex.substring(1, 3), 16);
        const g = parseInt(hex.substring(3, 5), 16);
        const b = parseInt(hex.substring(5, 7), 16);
        return `${r}, ${g}, ${b}`;
}
p5.js dude

rgb ke hex

function rgb(r, g, b){
  function toHex(a) { 
    if (a <= 0) return '00';
    else if (a >= 255) return 'FF';
    else return a.toString(16).toUpperCase();
  }
  return toHex(r) + toHex(g) + toHex(b);
}
Careful Camel

Rgb ke konverter warna hex

RGB To HEX Color Converter:
https://freetoolssite.com/tools/rgb-to-hex-color-converter
Said HR

Konversi RGB menjadi hex

const rgbToHex = (r, g, b) =>
  "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);

rgbToHex(0, 51, 255); 
// Result: #0033ff
thefazeelahmed

rgb ke konversi hex

// rgb to hex conversion
fn rgb(r: i32, g: i32, b: i32) -> String {
    format!("{:02X}{:02X}{:02X}", 
        r as f32 as u8, 
        g as f32 as u8, 
        b as f32 as u8) 
}

fn main() {
    let (r, g, b) = (123, 86, 200);
    println!("rgb {} {} {} to hex {} ", r, g, b, rgb(r, g, b));
}
Mackerel

Argb to Hex

return string.Format("#{0:X2}{1:X2}{2:X2}{3:X2}",
                     color.A,
                     color.R,
                     color.G,
                     color.B);
Proud Petrel

Jawaban yang mirip dengan “rgb ke konversi hex”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya