User talk:Phlsph7/Readability
Color scheme
edit
Generally a red → green color gradient is discouraged due to accessibility concerns. I recommend replacing const scoreColors
with the following:
const scoreColors = [ 'rgb(255,96,96)', 'rgb(223,124,146)', 'rgb(191,152,180)', 'rgb(187,163,180)', 'rgb(159,179,192)', 'rgb(149,188,202)', 'rgb(139,193,214)', 'rgb(134,192,222)', 'rgb(117,174,224)', 'rgb(110,255,241)',];
or something like it, which is largely a gradient from red to cyan/blue instead. — Remsense诉 03:33, 27 January 2024 (UTC)
- @Remsense: Thanks for the suggestion! I made an alternate version that uses your suggested color scheme. You can use it by opening your common.js and replacing the line
importScript('User:Phlsph7/Readability.js'); // Backlink: [[User:Phlsph7/Readability.js]]
- with the line
importScript('User:Phlsph7/Readability - Colorblind Friendly.js'); // Backlink: [[User:Phlsph7/Readability - Colorblind Friendly.js]]
- Phlsph7 (talk) 09:28, 27 January 2024 (UTC)
- I don't know much about the ideal color schemes for colorblindness. Changing the colors in the script is pretty straight-forward so please let me know if further adjustments to this scheme would be helpful. Phlsph7 (talk) 09:34, 27 January 2024 (UTC)
Thoughts on potential functionality
editI appreciate how simple this tool is, but I have been thinking about whether there are any additional figures it could present that would be of considerable use.
Considering your observation that too little variance in sentence size is likely not ideal in an article, whether sentences are too often short or long, perhaps some "variation" calculation would correlate with this? What pops into my head is simply averaging the difference in complexity between each pair of successive sentences in the article, but maybe there's a slightly smarter way of doing that. Remsense诉 13:09, 17 May 2024 (UTC)
- @Remsense: That's an interesting idea and it shouldn't be too difficult to implement. For this purpose, I assume we should focus only on the number of words per sentence and ignore word length. I haven't heard about your idea of looking pairs of neighboring sentences but it could work. Another approach might be to assess this globally via the standard deviation of sentence length. I think that is what this page calls "Sentence Variety Score". Your approach is probably more precise for what we are after since the standard deviation does not care about whether short and long sentences alternate or are found in different sections. The standard deviation would probably be the more standards approach. Phlsph7 (talk) 17:05, 17 May 2024 (UTC)
- @Remsense: I've added "Words per sentence" and "Standard deviation of sentence length" to the overview table. I could also implement your approach instead if you think it would be more helpful. Phlsph7 (talk) 08:05, 20 May 2024 (UTC)