If a level 25 character gets carried through a level 30 quest, will they receive less experience than if they did the same quest at level 30? Or do experience penalties only apply to quests that are too low-level?
Character_Level <= Quest_Level + 5 : Quest_XP = (100 %) or Full_Quest_XP
Character_Level = Quest_Level + 6 : Quest_XP = ( 80 %) or ROUND(Full_Quest_XP * 0.8 / 5) * 5
Character_Level = Quest_Level + 7 : Quest_XP = ( 60 %) or ROUND(Full_Quest_XP * 0.6 / 5) * 5
Character_Level = Quest_Level + 8 : Quest_XP = ( 40 %) or ROUND(Full_Quest_XP * 0.4 / 5) * 5
Character_Level = Quest_Level + 9 : Quest_XP = ( 20 %) or ROUND(Full_Quest_XP * 0.2 / 5) * 5
Character_Level >= Quest_Level + 10 : Quest_XP = ( 10 %) or ROUND(Full_Quest_XP * 0.1 / 5) * 5
The list above is an ESTIMATE and is very likely wrong, but it's something.
In other words, the more level difference between you and the quest, the lesser the XP.
Regarding your question however, Red, orange and yellow quests should give you 100% of the total quest XP.
Green quests give you less xp.
Gray quests give no (or very little?) xp.
Corrections are welcome. Just what I found on the internet & going off of memory here.