Git Product home page Git Product logo

code-like's Introduction

About me gigantz

Hi, I'm Orkhan Jafarov ๐Ÿ‘‹

I'm highly motivated software engineer that develop cool stuffs, contribute and realize any ideas!

What I do with my experience?

โ€ข Publish open source projects (Libs, packages and etc)
โ€ข Helping designers with Figma Plugins (Nisa Text Splitter / Make blob)
โ€ข Writing helpful articles for our Javascript-hood

How can you reach me?



What I use: #javascript #typescript #react #reactnative #html5 #css3 #nodejs #nextjs #express #postgresql #mongodb #git #graphql #redis #gatsby #jest #linux #sass #webpack #figma #sketch #babel #android #docker #jasmine #mysql #nginx #python

code-like's People

Contributors

gigantz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

code-like's Issues

12. Convert RGB โ†’ HEX is not correct

The code you've written is as follows

const rgb2hex = ([r, g, b]) =>
  `#${(1 << 24) + (r << 16) + (g << 8) + b}`.toString(16).substr(1);

console.log(rgb2hex([76, 11, 181]));
// #4c0bb5

Which the desired output is #4c0bb5 but what we get is 21760949 .

it's not correct

the correct way of writing the code is as follows

function rgbToHex(r, g, b) {
  return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
}

console.log(rgbToHex(0, 51, 255)); // #0033ff

And the reason it works because we are converting the number part to hex.

And also thanks for your awesome code you've share. i learned a lot from them.
Happy Coding! ๐Ÿ˜ƒ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.