question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generates the same color for long strings of equal length

See original GitHub issue

It seems like it generates the same color for long strings if they have the same number of characters.

E.g.

long sentence abc
long sentence def
long sentence xyz

all generate the same color.

Any thoughts on this?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
adiuscommented, Mar 12, 2016

Yeah I know that it’s because of the hash function =D What I was implying is “shouldn’t the default hash function be better than this!?”

2reactions
emilbayescommented, Jul 9, 2016

@shahinism lose lose is what @zenozeng suggested above

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create a hexadecimal colour based on a string with JavaScript
Here's an adaptation of CD Sanchez' answer that consistently returns a 6-digit colour code: var stringToColour = function(str) { var hash = 0; ......
Read more >
NetLogo 6.3.0 User Manual: Programming Guide
The same goes for patches and links. Some variables are built into NetLogo. For example, all turtles and links have a color variable,...
Read more >
Surface plot - MATLAB surf - MathWorks
This MATLAB function creates a three-dimensional surface plot, which is a three-dimensional surface that has solid edge colors and solid face colors.
Read more >
3.1 Using Data Types - Introduction to Programming in Java
Java's Color data type represents color values using the RGB color model where a color is defined by three integers (each between 0...
Read more >
Color | Android Developers
A color long always defines a color using 4 components packed in a single 64 bit long value. ... Indicates whether some other...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found