mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
[sixel] restrict to 99, but use true 100 scale for accuracy
This commit is contained in:
parent
5943d4e256
commit
1af9b16276
@ -38,7 +38,8 @@ typedef struct onode {
|
||||
// convert rgb [0..255] to sixel [0..99]
|
||||
static inline unsigned
|
||||
ss(unsigned c){
|
||||
return round(c * 99.0 / 255);
|
||||
unsigned r = round(c * 100.0 / 255); // use real [0..100] scaling
|
||||
return r > 99 ? 99: r;
|
||||
}
|
||||
|
||||
// get the keys for an rgb point. the returned value is on [0..999], and maps
|
||||
|
Loading…
x
Reference in New Issue
Block a user